Status of Dynamically Loadable D Libraries

John Colvin john.loughran.colvin at gmail.com
Sun Feb 10 15:41:53 PST 2013


On Sunday, 10 February 2013 at 22:11:52 UTC, Nick Ulle wrote:
> What's the current status of dynamic loading (and/or linking) 
> for D libraries?
>
> I've been playing with this a bit in hopes of calling a D 
> shared library from R through the C ABI, and noticed that on 
> Windows it seems fine, but on Linux dmd won't build my library 
> unless it includes main(), and it segfaults if I call writeln().
>
> I've seen this thread:
> http://forum.dlang.org/thread/hmhaldyfziejrplgzazt@forum.dlang.org
>
> And also this one:
> http://forum.dlang.org/thread/k3vfm9$1tq$1@digitalmars.com
>
> What I gather is that right now, DLLs work on Windows, but on 
> *nix, shared libraries cannot yet use anything from Phobos.
> 
> Am I correct that it's safe to dynamically load a D library on 
> Windows? How out-of-date is the information in the tutorial for 
> making DLLs on dlang?
>
> Is supporting dynamically loadable libraries a priority for the 
> developers, or something that might not happen for a while

For shared libraries (linux) I'd use ldc . It's just works.


More information about the Digitalmars-d mailing list