On Wednesday 27 March 2002 07:20 pm, Philipp Thomas wrote:
Close, but not quite a cigar ;-) Usually a library has a full version:
lib<name>.so.<major version>.<minor version>.<patchlevel>
libraries also usually have internal name, the so called soname, which gets assigned at the time the library is linked. As normally libraries with the same major version are compatible, the soname is normally
lib<name>.so.<major version>
Part of the job of ldconfig is reading these sonames and creating symbolic links from this soname to the real library.
Now if you link a program this library, this soname will get recorded in the program. If this program is run, the dynamic linker will search for a file with this name (it will actually look into the cache created by ldconfig).
The lib<name>.so is usually only a symbolic link to the actual library and is solely used for linking. If you request a specific library via the -l<name> switch, the linker (ld) will first search for lib<name>.so and then for lib<name>.a (that is, if you didn't pass -static, which would make it search for lib<name>.a only).
I had been wondering about all this stuff and recently discovered that it's pretty well described in the Program Library HOWTO. Paul Abrahams