views:

1094

answers:

2

My build process consists of Qt's qmake Makefile generator and the typical make utility bundled with linux.
My application consists of a few shared libraries and the main application is linked against them.
How can I apply the typical linux versioning scheme on my libraries? (Use version 2 -> link against foo.so.2 that points to foo.so.2.y.z with an ldconfig generated link).

The answer doesn't have to be specific for my build process.

+6  A: 

Your library should be named libfoo.so.2.y.z, with symlinks of libfoo.so.2 and libfoo.so both pointing to that. The library should be created using -soname libfoo.so.2 in the linker command line (or -Wl,-soname,libfoo.so.2 on the gcc command line).

Hope that helps!

Chris Jester-Young
A: 

Does this allow you to build another program against another version of the library, and run both at the same time? In a more detailed way, how can I build prog1 with libfoo.so.1, then prog2 with libfoo.so.2 (second version of the same library), and run prog1 and prog2 at the same time on the same machine?

daniel