www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - What is the status of dlls on windows?

reply "TheFlyingFiddle" <theflyingfiddle gmail.com> writes:
How complete is dll support on windows (32/64)? I'm specifically 
interested in D-to-D dlls.

Can i:

1. Load phobos as a DLL
2. Throw exceptions over dll boundary
3. Use multiple threads with thread local storage in loaded dll.
Oct 20 2013
next sibling parent "evilrat" <evilrat666 gmail.com> writes:
On Monday, 21 October 2013 at 00:05:28 UTC, TheFlyingFiddle wrote:
 How complete is dll support on windows (32/64)? I'm 
 specifically interested in D-to-D dlls.

 Can i:

 1. Load phobos as a DLL
 2. Throw exceptions over dll boundary
 3. Use multiple threads with thread local storage in loaded dll.
this all should work on windows quite for a long time now, but i don't really tested it that much. all problems with shared libs were on *nix, and 2.064 looks promising to bring it working.
Oct 20 2013
prev sibling next sibling parent "FreeSlave" <freeslave93 gmail.com> writes:
On Monday, 21 October 2013 at 00:05:28 UTC, TheFlyingFiddle wrote:
 2. Throw exceptions over dll boundary\
2. Last time I tried it, exceptions were not thrown over dll boundary. But it works fine on Linux for shared object files.
Oct 21 2013
prev sibling next sibling parent Benjamin Thaut <code benjamin-thaut.de> writes:
Am 21.10.2013 02:05, schrieb TheFlyingFiddle:
 How complete is dll support on windows (32/64)? I'm specifically
 interested in D-to-D dlls.

 Can i:

 1. Load phobos as a DLL
 2. Throw exceptions over dll boundary
 3. Use multiple threads with thread local storage in loaded dll.
D-to-D dlls are pretty much not useable because the "export" protection level is implemented in a way which makes it over complicated to use (you always need both .d and .di files) and even fails to export some important symbols. If you want to export simple functions it will work. Exporting anything else (classes, structs, etc.) will just be overly complicated or not work at all. See: http://d.puremagic.com/issues/show_bug.cgi?id=9816 and: http://wiki.dlang.org/DIP45 I tried to push DIP 45 for quite some time. The only response I got from Walter numerous times was that he didn't have time to take a look at it. The newsgroup discussion on the topic also only had 3 contributors. There doesn't seem to be much general interest in this topic because most people seem to be using D on linux. I'm planning to push this topic again to get some offical approval because I will never again put work into something D-related without getting it approved first. Kind Regards Benjamin Thaut
Oct 21 2013
prev sibling parent Martin Nowak <code dawg.eu> writes:
On 10/21/2013 02:05 AM, TheFlyingFiddle wrote:
 How complete is dll support on windows (32/64)? I'm specifically
 interested in D-to-D dlls.

 Can i:

 1. Load phobos as a DLL
There is no phobos.dll yet. Some work has been done, but there are many open problems.
 2. Throw exceptions over dll boundary
This requires a phobos.dll because you'd run into ODR violation when statically linking against phobos.lib.
 3. Use multiple threads with thread local storage in loaded dll.
Don't know.
Oct 25 2013