On Fri, 3 Jul 2009, Andy Hefner wrote:
On 7/3/09, Luis Oliveira luismbo@gmail.com wrote:
It used to be librt.so.1, but it was changed to librt.so, not sure why. Is there any system where "librt.so.1" doesn't work but "/lib/librt.so.1" would?
Possibly, but only on perverse systems. For example /usr/local/lib/librt.so.1 is broken but found before the functional /lib/librt.so.1.
Changing /usr/lib to /lib was random flailing around on my part. I'm not sure where it's supposed to live. On the older kubuntu VM I've been doing some tests in, it has:
/lib/librt-2.6.1.so /lib/librt.so.1 -> /lib/librt-2.6.1.so /usr/lib/librt.so -> /lib/librt.so.1
For reasons unknown to me, despite the /usr/lib/librt.so existing, it couldn't find librt until I changed it to librt.so.1.
Some points wrt C/C++ linking: - Libraries don't "belong" anywhere; the distro/end user gets to choose which libs go where. Shadowing system libs is a feature. - librt.so.1 is more specific than librt.so; for example librt.so could point to librt.so.2. - Different unix OSs have different ways of versioning libraries. - On linux, shared libraries are usually loaded by ld.so; see `man ld.so`. CL probably couldn't find librt.so because it was in the less standard /usr/lib directory whereas librt.so.1 was in /lib.
Later, Daniel