I'm struggling a bit with some options for linking to the project I'm currently working on:
I am trying to create a shared library linked to two other libraries. (Lets call them libfoo.soand libbar.so)
My output library should be a shared library, and I want a static link libfoo.soto the resulting library, but libbar.soshould be linked as a dynamic library. (It libbar.soshould be available on every computer where it is libfoo.sonot available, and I do not want the user to install / send it with my binaries.)
How can I archive this?
My current build instruction looks 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 defend myself: I'm not a c / C ++ specialist, so sorry if this question seems silly.
source
share