POV-Ray : Newsgroups : povray.programming : Broken Arrow : Re: Broken Arrow Server Time
25 Feb 2024 04:15:09 EST (-0500)
  Re: Broken Arrow  
From: Le Forgeron
Date: 28 Jan 2016 11:41:39
Message: <56aa44c3$1@news.povray.org>
Hash: SHA256

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

Version: GnuPG v2


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.