0

I have a shared library A which uses shared library B, and an application P which relies on A.

I don't want to link P against A and B, but to link P against A only, and A against B (and somehow hide B to P)

How can I do ?

The shared libraries are generated with 'g++ -shared...'

1 Answer 1

1

If you don't need B to be a standalone shared library - which can be used on it's own, don't build it as a shared library, instead build a static library with the code complied with -fPIC - then link this static library to the shared library A.

If you need a shared library of B as well, then use the same objects to build a shared library.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.