linking problems with several static libraries

linking problems with several static libraries

Diego Iastrubni elcuco at kde.org
Wed Jul 10 23:23:49 IDT 2013


On יום רביעי, 10 ביולי 2013 21:43:54 Omer Zak wrote:
> On Wed, 2013-07-10 at 21:31 +0300, Diego Iastrubni wrote:
> > My program needs liba, which in turn needs libb.. which in turn needs
> > libk. The last libk needs symbols from liba.. and this is where it gets
> > funky. While linking g++ complains that symbols are missing ... and from
> > ar+nm I see that those symbols are avarilable on liba.
> 
> You did not say if those libraries are your employer's or provided by
> 3rd parties.
> 
> If the libraries are your employer's, then the long range solution is to
> restructure (another term is refactor) them to eliminate the circular
> dependencies from which you suffer.
> 
> This would also make it possible to develop unit tests for the libraries
> and for your project in general.
> 
> If the libraries are provided by a 3rd party, then report a bug (!)
> against them, and have them refactor the libraries to fix the bug.

All libraries are 3rd party libs. Even the parts of code I have are 
obsfucated. Really nice trick.

And I was under impression that "ld" was supposed to handle such kind of 
cyclic dependencies. 



More information about the Linux-il mailing list