Welcome to Questionaries, where you can ask questions and receive answers from other members of the community.

Let us know at info@questionaries.org

Link one shared library static to my shared library

10 like 0 dislike
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.
asked 2 years ago by DBA-boss (120,990 points)

Your answer

Email me at this address if my answer is selected or commented on:
Privacy: Your email address will only be used for sending these notifications.

0 Answers

Related questions

10 like 0 dislike
1 answer
9 like 0 dislike
1 answer
asked 2 years ago by DBA-boss (120,990 points)
7 like 0 dislike
0 answers
6 like 0 dislike
0 answers
asked 1 year ago by DBA-boss (120,990 points)
11 like 0 dislike
1 answer
asked 2 years ago by DBA-boss (120,990 points)