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' 
有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top