Suppose I have a library called
- its version is
0.4is the API version and
2is the release number which may add new API functions.
Should the soname be
libfoo.so.0.4.2 or something else?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
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
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.
libfoo.4.2 turns into
libfoo-1.so.0.1 when bumping version from
Such scheme makes it easier to install several versions of your library if some old software was not yet rewritten to totally new api.
Normaly you create file libfoo.so.0.4.2 and symlink libfoo.so.0 -> libfoo.so.0.4.2