LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   shared library naming conventions? (https://www.linuxquestions.org/questions/linux-general-1/shared-library-naming-conventions-769982/)

bjharker 11-18-2009 11:06 AM

shared library naming conventions?
 
Hi all-

Yesterday I spend most of the day installing and configuring some drivers and other software for a custom system. After finally getting everything up and running, I am now curious about the following:

Why are shared libraries in Linux named like libfoobar.so.6? What's with the .6? I've found that a lot of my install/configure issues over the years could be fixed by doing something like "ln -s libfoobar.so.6 libfoobar.so"

Is there some overarching reason why every shared library doesn't simply have a .so extension? It seems like a lot of problems could be avoided, but hey, what do I know?

Any perspectives? Thanks!

ShadowCat8 11-18-2009 12:23 PM

Well, there is a certain amount of slotting/versioning that is done with the shared libraries with those numbers so other software that depends on the library can tell if the library is a compatible version. And, if your system is up-to-date with all the linking done, you should have the links set for you by the installer, the installing package or whatever utility your distribution has for checking the sanity of your libraries. (In Gentoo, it's 'revdep-rebuild'.)

And for the links, when everything is set, I end up with stuff like:
Code:

tech7 ~ # ls -l /lib/libbz2.so*
lrwxrwxrwx 1 root root    15 Jan 20  2009 /lib/libbz2.so -> libbz2.so.1.0.5
lrwxrwxrwx 1 root root    15 Jan 20  2009 /lib/libbz2.so.1 -> libbz2.so.1.0.5
lrwxrwxrwx 1 root root    15 Jan 20  2009 /lib/libbz2.so.1.0 -> libbz2.so.1.0.5
-rwxr-xr-x 1 root root 66736 Jan 20  2009 /lib/libbz2.so.1.0.5
tech7 ~ #

HTH.

knudfl 11-19-2009 08:40 AM

Example:
Real name : libfoobar.so.6.10
so name : libfoobar.so.6

Real name : libfoobar.so.6.20
so name : libfoobar.so.7

Then it is your decision, which version to be libfoobar.so
Or it can be decided by the program, you compile.

http://tldp.org/HOWTO/Program-Librar...libraries.html
§ 3.1.1
http://www.linuxquestions.org/questi...9/?highlight#2
.....


All times are GMT -5. The time now is 10:26 AM.