dynamic library building and loading

Jacob Carlborg doob at me.com
Thu Sep 27 23:09:55 PDT 2012


On 2012-09-28 02:04, Rob T wrote:

> I'm using C++ main app that dynamically loads shared libs at runtime,
> but I cannot load D shared libs because they cannot be linked to the
> non-fPIC built phobos2/druntime lib. It seems that the only way to get
> things working is to re-build the C++ code so that it is linked with
> non-fPIC phobos2, but this is not something I want to be doing.
>
> So if I read this right, I can build phobos/druntime with -fPIC from the
> source code and it will work OK? If so, then why was this not done with
> the latest distrubution package, or is this only possible after a
> certain version number?

No, it will not work ok. Depending on what you do in the D code it might 
work, but everything will not work. Perhaps if you limit yourself to a C 
subset. See one of my other posts:

http://forum.dlang.org/thread/k3vfm9$1tq$1@digitalmars.com?page=3#post-k4219f:24uft:241:40digitalmars.com

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list