I am writing a program using Qt Creator, on Linux. It uses a library, for which I have both the .so
and the .a
equivalents in the /usr/lib
directory, for example:
/usr/lib/libuseme.a
/usr/lib/libuseme.so
From what I understand, if I link to the .so
, it will be linked dynamically, but if I link to the .a
it will be linked statically.
In this case, I want to link statically, to give me a better chance of distributing my program in a self-contained way.
But the -l
option to the linker only allows the library name, not including the lib
or the extension to be specified - e.g.
-luseme
So how do I indicate that I want it to link (statically) to the .a
, not dynamically to the .so
?