Windows program instant crash: no messages.

Andrew Wiley wiley.andrew.j at gmail.com
Tue Jun 12 01:50:14 PDT 2012


On Tue, Jun 12, 2012 at 1:32 AM, Dmitry Olshansky <dmitry.olsh at gmail.com> wrote:
> On 12.06.2012 11:17, Nekroze wrote:
>>
>> Hello. I am trying to make a wrapper to use the DarkGDK 3d game engine
>> for windows with D and i am doing rather well so far. I have just gotten
>> it to successfully compile however the resulting exe instantly crashes
>> and outputs nothing at all even though the very first command in WinMain
>> is writeln which doesnt show up.
>
>
> It may be the case that you need to call rt_init(); at first line of
> WinMain. Every time I see WinMain problems it boils down to D runtime not
> setup properly.

I agree. Take a look at http://dlang.org/windows.html
Working from that, I was able to get your app to begin to start up.
The other trick is that when you structure your main this way,
stdout/stderr/stdin don't seem to be set up for you (at least, not
with MinGW GDC). I added this:
stdout = File("test.txt", "w");

and now test.txt contains this:
%sCreating Swindow
%sInitializing DarkGDK

It's still crashing, but it's getting significantly farther. I haven't
dug enough to figure out what's going on now.


More information about the Digitalmars-d-learn mailing list