-----BEGIN PGP SIGNED MESSAGE-----
Le 28/01/2016 15:49, clipka a Ã©crit :
> Are you sure that's what's happening? Because last time I checked,
> there is no problem linking two libraries into one executable even
> if they recursively call each other. And I don't think it can't get
> any more interlocked than that.
If you "link" with shared libraries, usually no problem. (but you get
other kind of problems)
But try doing that with static libraries, and the linker can be a PITA.
Well, some linkers... not all of them.
Recursive calls might be ok ( A::a calls B::b which calls again A::a,
the linker might have kept the A::a name, so all is fine. but in some
situation like A::a calls B::b which calls A::z, very first reference
of it ever, which then calls B::c, also first time,...and so on, it
can badly fails). Notice that such intricacy is usually a sign of a
design problem (easy solution: merge both libraries into a single one) )
Some linkers try to be smart, to reduce the size of the final binary,
so getting only the parts they really need from the static libraries.
Some other linkers are less smart: take everything, resolves name and
complains when provided more than once, leaving unresolved names up to
any system dynamic library (then execution will fails to resolve them,
but that's not the linker's problem anymore).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-----END PGP SIGNATURE-----
Post a reply to this message