On numbers as part of library names

Bernhard Rosenkraenzer bero at arklinux.org
Wed Aug 8 16:46:38 PDT 2007


> And yes, the library names
>   must be different because otherwise you end up with
>
>         libpixman.so.<gobbledigook>
>
>   and
>
>         libpixman.so.<different gobbledigook>
>
>   and nobody will know what is actually installed, or which of the
>   libpixman.so's are compatible, or what "-lpixman" means.

FWIW, that's not necessarily true.

You can have e.g.

/usr/lib/libpixman.so.1
/usr/lib/libpixman.so.2
/usr/lib/libpixman.so -> symlink to libpixman.so.2
/usr/lib/obsolete-stuff/libpixman.so -> symlink to libpixman.so.1

Both are available, and you can see which is being used by running ldd or the 
likes. You can see what is installed by looking in /usr/lib, and it's pretty 
well defined that anything with the same major number in the soname is (ABI) 
compatible and anything with a different major number is not.

If you use -lpixman, the current version is used. If you need to link a legacy 
app against the old version, all you have to do is 
add -L/usr/lib/obsolete-stuff

This is not necessarily less obfuscated or better, but numbers as part of 
library names are not the only possible solution.



More information about the xorg mailing list