Problems with shared library (-fPIC) and tango
Marius Muja
mariusm at cs.ubc.ca
Sat Jul 5 13:07:08 PDT 2008
e-t172 wrote:
>
> You can build a D shared library without including Tango in it (there
> will be undefined references in the shared library, which will be
> resolved when Tango is linked with the main executable).
>
> If you're using GDC, use the -nophoboslib switch when creating your
> shared library to avoid linking to Tango.
That won't really work for me, my shared library is in fact a matlab MEX
file, so I'm not creating a main executable in the end, matlab will load
it when needed.
I'm also building a python binary extension this way, where I have the
same problems.
>
> Some problems can occur, though. If you happen to modify your shared
> library in such a way that the library makes use of a Tango symbol it
> didn't use before, it won't work unless you relink your executable to
> include the new symbol. That kind of defeats the whole purpose of having
> shared libraries. Of course, one could include all Tango symbols in the
> executable to solve the problem, but then you will end with a huge
> executable because all Tango will be included in it.
More information about the Digitalmars-d
mailing list