I have a shared library with some home functions that I compile into my other programs, but I need to link the final program with all the libraries that I used to compile the static library. Here is an example:
I have a foo function in a library that requires a function from another libbar.so library.
In my main program, to use the foo function, I need to compile it with the -lbar flag. Is there a way that I can collect statically in the library so that it includes all the necessary code from other libraries, and I can compile my final program without the need to use the -lbar flag?
c ++ c static linker shared-libraries
Simon walker
source share