I am struggeling a little bit with some options for linking on a project I am currently working on:
I am trying to create a shared library which is linked against 2 other libraries. (Lets call them libfoo.so
and libbar.so
)
My output library has to be a shared library and I want to static link libfoo.so
to the resulting library, but libbar.so
should linked as a dynamic library. (libbar.so
should be available on every machine, where libfoo.so
is not available and I do not want the user install it / ship it with my binaries.)
How could I archive this?
My current build instruction look like this:
c++ -Wall -shared -c -o src/lib.o src/lib.cpp
c++ -Wall -shared -o lib.ndll src/lib.o -lfoo -lbar
I my defense: I am not a c/c++ expert, so sorry if this question seems to be stupid.