Thread overview
How to create a DLL
Jun 14, 2007
Frank Benoit
Jun 14, 2007
torhu
Jun 14, 2007
Sean Kelly
Jun 14, 2007
Charlie
Jun 15, 2007
Walter Bright
Jun 16, 2007
Charlie
June 14, 2007
I try to build a DLL with dmd on windows with tango.

with empty functions that worked. When i put only a switch statement
into a method, the linker complains about a missing "__Dmain". Why is that?
June 14, 2007
Frank Benoit wrote:
> I try to build a DLL with dmd on windows with tango.
> 
> with empty functions that worked. When i put only a switch statement
> into a method, the linker complains about a missing "__Dmain". Why is that?

Did you include a DllMain?

http://www.digitalmars.com/d/dll.html

Also check out the mydll example the comes with dmd.
June 14, 2007
Frank Benoit wrote:
> I try to build a DLL with dmd on windows with tango.
> 
> with empty functions that worked. When i put only a switch statement
> into a method, the linker complains about a missing "__Dmain". Why is that?

I don't think DLL's are created with the linker, they are created with lib.exe -> http://www.digitalmars.com/ctg/lib.html
June 14, 2007
torhu wrote:
> Frank Benoit wrote:
>> I try to build a DLL with dmd on windows with tango.
>>
>> with empty functions that worked. When i put only a switch statement
>> into a method, the linker complains about a missing "__Dmain". Why is that?
> 
> Did you include a DllMain?
> 
> http://www.digitalmars.com/d/dll.html
> 
> Also check out the mydll example the comes with dmd.

Please note that the process of actually initializing the runtime for a Tango DLL is somewhat different than Phobos.  You basically just call rt_init() to initialize and rt_term() to terminate.  I'll see about documenting this somewhere.


Sean
June 15, 2007
Charlie wrote:
> Frank Benoit wrote:
>> I try to build a DLL with dmd on windows with tango.
>>
>> with empty functions that worked. When i put only a switch statement
>> into a method, the linker complains about a missing "__Dmain". Why is that?
> 
> I don't think DLL's are created with the linker, they are created with lib.exe -> http://www.digitalmars.com/ctg/lib.html

No, DLLs (aka Dynamic Link Libraries) are created by the linker. Libraries (aka Static Link Libraries) are created by lib.
June 16, 2007
Walter Bright wrote:
> Charlie wrote:
>> Frank Benoit wrote:
>>> I try to build a DLL with dmd on windows with tango.
>>>
>>> with empty functions that worked. When i put only a switch statement
>>> into a method, the linker complains about a missing "__Dmain". Why is that?
>>
>> I don't think DLL's are created with the linker, they are created with lib.exe -> http://www.digitalmars.com/ctg/lib.html
> 
> No, DLLs (aka Dynamic Link Libraries) are created by the linker. Libraries (aka Static Link Libraries) are created by lib.

Ack, ignore me !