gcc linking shared libraries with dependent libraries

Posted by Geng on Stack Overflow See other posts from Stack Overflow or by Geng
Published on 2012-06-17T03:10:19Z Indexed on 2012/06/17 3:16 UTC
Read the original article Hit count: 483

Filed under:
|

I have a complicated project with multiple executable targets and multiple shared libraries. The shared libraries currently don't have their dependent shared libraries linked in, and the result is that linker arguments to build the executables are hideously long and hard to maintain. I'd like to add in the dependencies so the Makefiles become much cleaner.

I want to add the following (example): gcc -shared -o libshared.so -lshared_dependent1 -lshared_dependent2 objfile1.o objfile2.o

Is there a way to test if all the symbols in libshared.so will resolve based on that line? Is there a way to print out if any of the shared_dependent libraries specified were unnecessary?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about gcc

Related posts about linker