* Anders Johansson (andjoh@cicada.linux-site.net) [011208 02:20]:
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
Thorstan Kukuk can give a much better answer than I can, but my understanding is that /etc/ld.so.cache (created by ldconfig) creates a mapping from sonames to filenames. E.g., libfoo might have a soname of foo so that you can link against it with -lfoo, but the file that that contains the object code might be named blahblah. If you run the ld.so.cache through strings you can kind of see what's going on: ckm@hades: ~> strings < /etc/ld.so.cache|grep GL libMesaGLU.so.3 /usr/lib/libMesaGLU.so.3 libMesaGL.so.3 /usr/lib/libMesaGL.so.3 libGLU.so.1 /usr/lib/libGLU.so.1 libGL.so.1 /usr/lib/libGL.so.1 -- -ckm