* Anders Johansson [Sat, 8 Dec 2001 11:20:44 +0100]:
How does the linker determin which lib to open when it's been dynamically linked to -lsomething. Sometimes it seems to be libsomething.so, other times libsomething.so.1. There must be a general rule to this
There is no real general rule. Dynamic libraries have an internal name, the so called soname, set at the time the library is created. Normally this is lib<name>.so.<major version> (I don't know what gets set if no soname is explicitly passed to the linker). This soname gets recorded in the binary that is linked to the library (AFAIR via DT_NEEDED). It's this soname that the dynamic linker ld.so searches for when resolving dependencies and that's also why ldconfig creates symlinks from the soname to the actual library. cheers Philipp -- Penguins to save the dinosaurs -- Handelsblatt on Linux for S/390