Win32 example/tutorial with GC?

Frits van Bommel fvbommel at
Tue May 1 12:34:44 PDT 2007

Johnny wrote:
> It seems that the Phobos library itself refers to _Dmain and linker 
> can't find it, so where is _Dmain, and why isn't it found?

"_Dmain" is how the "main" of your program normally gets renamed 
("mangled") by the D compiler. It's not found because you didn't write 
one :).
What happens if you add an empty "void main() {}" ?

I'm pretty sure the Windows version of DMD (or perhaps optlink) will 
automatically use WinMain instead of main if it sees it, but I'm not 
sure about GDC/MinGW. Maybe some special command-line option needs to be 

More information about the D.gnu mailing list