location explicitly (as in /usr/local/lib/libFoo.so.2.0.1 (note, no -l option is needed here)). Your app links to this specific version of libFoo.so, and has libFoo.so's soname string embedded into itself. A final note: if you are writing your own shared library, remember to properly use the -soname option (for example, -soname=libFoo.so.2 ).