Re: link shared library against another shared library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi qcp,

> 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

g++ -o P P.cpp -lA

That will make P directly dependent on libA.so, and not directly dependent
on libB.so (although it is indirectly dependent on libB.so, via libA.so).

You can use...  ldd P  ...to display the dependencies.  Depending on your
ldd, it may-or-may-not show indirect dependencies as well.  Check your
platform's "man ldd" for relevant flags.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux