Pregunta

I am using Qt for GUI and building my project in waf. For switching to windows subsystem from console(default) i had to pass this argument to the VS linker throught my wscript(waf)

subsystem='windows' 

i added this in build part for waf file and I am getting this error

MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
C:\cygwin\home\sobingt\project\build\src\View\app.exe : fatal error LNK1120: 1 unresolved externals

I want to run this program as windows not as console.The Code works if i run it as console

subsystem='console' 
¿Fue útil?

Solución

You need to link against qtmain.lib (IIRC). This provides a shim around winmain which you need for windowed windows apps.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top