A special treat

Walter Bright newshound1 at digitalmars.com
Tue Feb 9 13:28:27 PST 2010


Steven Schveighoffer wrote:
> On Tue, 09 Feb 2010 15:58:37 -0500, Walter Bright 
> <newshound1 at digitalmars.com> wrote:
> 
>> Steve Teale wrote:
>>> The inability to do this is a real show-stopper for D on Linux, and 
>>> unless things have got better since I last tried, the same can be 
>>> said for Windows DLLs.
>>
>> The dmd/samples/d/dserver.d is an example of a Windows DLL in D.
> 
> According to Don (haven't tried, because I don't have a windows box 
> handy), any D2 DLL will fail, even an empty one because of 
> http://d.puremagic.com/issues/show_bug.cgi?id=3342

It is a bad problem, but it doesn't apply to implicitly loaded DLLs, 
only dynamically loaded ones, and it also doesn't apply to Vista or 
Windows 7.


> That aside, having to handle manual steps to ensure the runtime doesn't 
> lose its mind is unacceptable.  It has to be handled without any manual 
> runtime coding to be a viable solution.  DDL is not a solution, its a hack.
> 
> In other words, I should be able to flip a compiler switch to build a 
> shared lib, and I shouldn't have to do anything special aside from 
> exporting symbols.  This is the way it is in all other programming 
> languages.
> 
> Until Phobos is a shared lib, I don't think we need to have any 
> discussions about any existing solutions.  That is requirement number 1 
> for saying D supports shared libs.

Shared libraries (on Linux) and Windows DLLs are very different things.

Phobos as a DLL is a different problem than creating DLLs with D. DLLs 
in D can be created that are statically linked with Phobos, and that can 
be accessed by any executable in any language.



More information about the Digitalmars-d mailing list