Reputation: 2623
I have a static and a dynamic library with the same name: libclsocket.a and libclsocket.so When I specify what library I want to link to i simply enter -lclsocket as the library. My program complies and runs perfectly fine, but what library am I using? the static library or the dynamic library? I want to give my friend my program, and I'm not sure If i need to include the libraries in the release. C++, codelite, pcLinuxOS 2010
Upvotes: 17
Views: 14203
Reputation: 4444
If you use the -static
flag, all components will be made static. And -l
may include shared libraries. So specifying the static library filename (e.g. with /usr/lib/libfoo.a
for example, no -l
prepended), should get you the desired effect.
Upvotes: 2
Reputation: 3371
You can try running ldd
on the executable and seeing if the accompanying .so is being detected as required in the list of dependencies.
ldd man page is here.
Upvotes: 8