Oh, I see.<div>That's very convenient.<br><br><div class="gmail_quote">On Wed, Jul 20, 2011 at 12:04 AM, Andrej Mitrovic <span dir="ltr"><<a href="mailto:andrej.mitrovich@gmail.com">andrej.mitrovich@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 7/20/11, Jimmy Cao <<a href="mailto:jcao219@gmail.com">jcao219@gmail.com</a>> wrote:<br>
> What?  I've never needed to do that when compiling programs with<br>
> -L/exet:nt/su:windows:4.0<br>
> on Windows.<br>
><br>
<br>
</div>If you use a main() function, DMD will add the runtime stuff for you.<br>
But if you use WinMain as your main function, you have to initialize<br>
manually.<br>
<br>
For example, if you try to compile and run this app:<br>
<br>
module win;<br>
<br>
import core.runtime;<br>
import std.c.windows.windows;<br>
<br>
extern (Windows)<br>
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR<br>
lpCmdLine, int iCmdShow)<br>
{<br>
    int[] a;<br>
<br>
    a.length = 5000;<br>
    auto b = a[];<br>
<br>
    return 1;<br>
}<br>
<br>
> dmd win.d -L/exet:nt/su:windows:4.0 && win.exe<br>
<br>
You'll see that it crashes:<br>
---------------------------<br>
win.exe - Application Error<br>
---------------------------<br>
The instruction at "0x00407cf6" referenced memory at "0x00000000". The<br>
memory could not be "read".<br>
<br>
<br>
Click on OK to terminate the program<br>
Click on CANCEL to debug the program<br>
---------------------------<br>
OK   Cancel<br>
---------------------------<br>
</blockquote></div><br></div>