Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Take a package like sqlite3:

Note that the linker name (/usr/lib/ only appear in the -dev package. The same pattern holds true for almost all shared libraries. Why? Won't this confuse programs that tries to dynamically load sqlite3 using dlopen("") when that file is missing unless you have the -dev variant?

share|improve this question
It allows the OS to inform the binary of what version is installed, so it can select from multiple installed versions without conflicting. – RobotHumans Apr 22 '13 at 21:16

The file is only a symbolic link to the fully versioned library file name, At runtime, the dynamic loader only knows about the fully versioned library. This is true for most shared libraries. There are some libraries which are not versioned, and only available as for example. However, such libraries are also packaged correctly, as appropriate.

Programs should not be trying to dlopen the non-versioned link of the library. If they wish to do that, they should instead use the filename, for example, which is installed in the binary library package, rather than the accompanying -dev package. This way the program will continue working if sqlite3 breaks API compatibility at some point, and there is a instead. Using would ensure the program would use the API of the library which it was written to work with.

share|improve this answer
Thanks, so what you're saying is dlopen("") is a programming error and should always be dlopen("") instead? If so, do you have a references for that statement because I've seen lots of code trying to dlopen non-versioned shared libraries. – Björn Lindqvist Apr 24 '13 at 12:59
It's certainly bad practice. I don't have a reference to point you to, but the problems with trying to load the one without the so version should be obvious. If you load, and require a symbol that is in but was removed from, then your program will break when loading when it points to – dobey Apr 24 '13 at 19:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.