gcc linking shared libraries with dependent libraries
- by Geng
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.