View previous topic :: View next topic |
Author |
Message |
baxissimo
Joined: 23 Oct 2006 Posts: 241 Location: Tokyo, Japan
|
Posted: Sun Feb 18, 2007 6:42 pm Post subject: Making DLL requires -gui flag? |
|
|
Just trying to run the basic DLL example from here:
http://www.digitalmars.com/d/dll.html
When I run Bud on it (with a simple bud mydll.d), I get a ton of linker errors. It seems to build a valid dll, but the linker errors are annoying.
I noticed that adding the -gui flag got rid of the linker errors. Is this the right thing to do? Perhaps -gui should be added automatically if bud finds either WinMain or DLLMain?
Seems odd, anyway, because clearly this DLL contians no GUI. I guess -gui really just means "link with the everything and the kitchen sink".
[edit]
Further info here. Actually it's weirder than I thought. bud -gui foo.d builds a dll, but for some reason it crashes at the first call to it.
Following the directions on the above page using dmd directly works fine. The sizes of the DLLs created both ways have the same size.
So is bud doing anything besides just the plain vanilla specified on that page?
Namely linking like this:
Code: |
dmd -ofddll.dll ddll.d ddll_vc.def
|
Using a def file like this:
Code: |
LIBRARY ddll.dll
EXETYPE NT
|
Because that seems to work fine. Whatever bud is doing does not.
Any ideas? |
|
Back to top |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Sun Feb 18, 2007 10:34 pm Post subject: Re: Making DLL requires -gui flag? |
|
|
baxissimo wrote: |
Whatever bud is doing does not.
Any ideas? |
For some stupid reason, I forgot to link in kernel32 and user32 libraries when doing a DLL link. You can add these to your command line until I fix the code.
Code: |
bud somedll.d user32.lib kernel32.lib
|
_________________ --
Derek
skype name: derek.j.parnell |
|
Back to top |
|
|
baxissimo
Joined: 23 Oct 2006 Posts: 241 Location: Tokyo, Japan
|
Posted: Sun Feb 18, 2007 10:43 pm Post subject: |
|
|
Boffo! That works!
--bb |
|
Back to top |
|
|
|