kicad-developers team mailing list archive
Mailing list archive
Re: Linker Error (self made...)
On Wed, Aug 28, 2019 at 04:36:03PM +0200, Ian McInerney wrote:
> Just to be clear, I was only going to focus on cleaning up the static
> linkage in the current build process. While items in common could be moved
> into a new DLL, I don't have enough experience with that to try to attempt
> it right now.
The static linkage is required because the base units are different across
programs. Any code that needs to convert between internal and real world
length units links to a function that applies the conversion factor for the
program being linked currently.
The base class code is linked multiple times, once per kiface, and each
copy is linked against the appropriate version of the conversion function
for this kiface.
The "common" library collects all code that is not directly sensitive to
-DEESCHEMA, -DGERBVIEW or -DPCBNEW, but these functions are allowed to
reference functions that are -- so there will be undefined symbols in that
library that are filled in by the kiface. We can't delay resolving that to
runtime because we have multiple different definitions for these symbols,
which would conflict, and also Linux is the only platform that even allows
shared libraries with undefined symbols.