LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   gcc link shared library against another shared library (https://www.linuxquestions.org/questions/linux-newbie-8/gcc-link-shared-library-against-another-shared-library-658044/)

qcp 07-24-2008 03:14 PM

gcc link shared library against another shared library
 
Hi all,

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...'

Thanks for your answers

FranDango 07-25-2008 11:15 AM

You have to compile your shared library A first and install to a location contained in your path (/usr/local/lib for example). From that point on build your application using shared library A. Your application doesn't need to know that one of it's libraries uses other libraries as well.

I'm not sure, but I think that 'ldd' will reveal anyway all dependencies, so library B might show up on the list as well.

Is this needed for some workaround due to licensing issues, or is the client not supposed to know that parts of the code are using some external code?

Linux Archive


All times are GMT -5. The time now is 12:53 AM.