4

Suppose I have a library called libfoo and

  • its version is 0.4.2
  • where 0.4 is the API version and
  • 2 is the release number which may add new API functions.

Should the soname be libfoo.so.0.4, libfoo.so.0.4.2 or something else?

4

If api version is 0.4, and it is incompatible with other 0.* versions then you should set soname to libfoo.so.0.4. Actually soname can be any string, it is only needed to find proper shared library in your system when loading executable.

Many packages (or distros) follow naming scheme different from yours. For example libfoo version 0.4.2 with api 0.4 would become libfoo.so.4.2 with soname libfoo.4.

And when making substantial change to interface, requiring not just recompiling and minor correction here and there, but a lot of code rewrite in code using the library - bump the "major" major version by renaming library. Then libfoo.4.2 turns into libfoo-1.so.0.1 when bumping version from 0.4.2 to 1.0.1.

Such scheme makes it easier to install several versions of your library if some old software was not yet rewritten to totally new api.

0

Normaly you create file libfoo.so.0.4.2 and symlink libfoo.so.0 -> libfoo.so.0.4.2

  • I've the sysmlinks libfoo.so, libfoo.so.0.4.0, libfoo.so.0.4.1 but what should be the soname of the library. – Reinder Jun 6 '14 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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