extern(Windows, "user32.dll")

Benjamin Thaut via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 1 03:10:23 PST 2015


Am 01.02.2015 um 11:45 schrieb Vladimir Panteleev:
> On Sunday, 1 February 2015 at 10:40:06 UTC, Benjamin Thaut wrote:
>> Please no. Import libraries are the way it was designed
>
> Delphi does without them just fine.

C++ does with them just fine.

>
>> I'm currently implementing D-Dll support for Windows with dmd and
>> without import libraries it will never work.
>
> Why? I'm not suggesting to remove import library support.

I don't care what you are suggesting. If you want a implementation of 
Dll support without import libraries do it yourself. And lets just say 
it is required to link against druntime correctly. I don't want to give 
you a 4 page text explanation why.

>
> Dynamic loading delays the error until execution time, instead of link
> time, and is slower.

I hardly doubt that. If you link against a dll the windows binary loader 
is just doing the work for you. But the symbols are looked up in the dll 
by string either way.

Also, proof of concept: http://dpaste.dzfl.pl/efbd54314a69

The real issue here is, that dmd simply does not come with all 
neccessary import libraries when using optlink. As soon as you switch to 
the microsoft linkers this becomes a non issue.

Kind Regards
Benjamin Thaut


More information about the Digitalmars-d mailing list