February 17, 2013
MS linker by default allocates console window for programm if he see a main function as entry point and not allocates if he see a WinMain function as entry point.

So, if I don't want ugly console window for gui app, I can specify SUBSYTEM:WINDOWS linker flag and change a main to WinMain.
But I want to use ENTRY linker flag and do not modify source code.
With ENTRY flag a executable successfully compiled, but crashes at startup.

Any valid D Way workaround?

>dmd -release -m64 -L/SUBSYSTEM:WINDOWS fl64.lib fl_test.d
>LIBCMT.lib(wincrt0.obj) : error LNK2019: unresolved external symbol WinMain
>referenced in function __tmainCRTStartup
>fl_test.exe : fatal error LNK1120: 1 unresolved externals
>--- errorlevel 1120

When compiling without modification in source.

P.S.: Win 8 64 bit, Dmd 2.061. fl64.lib and fl64.dll - custom library.
February 17, 2013
Oh, sorry.

Valid linker flag to do this

> -L/ENTRY:"_Dmain"
February 17, 2013
On Sunday, 17 February 2013 at 09:13:57 UTC, Michael wrote:
> Any valid D Way workaround?

Top | Discussion index | About this forum | D home