Win64, SUBSYSTEM:WINDOWS and friends

Michael pr at m1xa.com
Sun Feb 17 01:13:56 PST 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.


More information about the Digitalmars-d mailing list