Program exited with code 1

user1234 user1234 at 12.nj
Thu Apr 19 08:24:55 UTC 2018


On Thursday, 19 April 2018 at 08:13:00 UTC, Andrey wrote:
> Hello,
> I wrote a small test code with WinApi:
>
> ----------------------------------------------------
> import core.runtime;
> import std.utf;
>
> import core.sys.windows.windows;
> import core.sys.windows.wingdi;
>
> class Test
> {
>     public this() nothrow
>     {
>
>     }
> }
>
> extern(Windows)
> int WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, 
> int nCmdShow)
> {
>     new Test(); // error is here
>     return 0;
> }
> ----------------------------------------------------
>
> When I run it, there is an error: Program exited with code 1.
>
> If I comment "new Test();" - no error happens. Why?

The run-time is not already initialized but the "new" operator 
relies on it.


More information about the Digitalmars-d-learn mailing list