1

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' 

1 Answers1

1

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

RedX
  • 14,749
  • 1
  • 53
  • 76
  • I am not at home to look it up. But it should be included with your Qt distribution in the same folder where QtCore.lib an QtMain.lib are. I don't really remember how to input it in a pro file though. – RedX Apr 23 '12 at 12:25
  • Its called qtmain.lib it's still there in my qt4.8. Just add it to the linker like you would any other qt component. – RedX Apr 23 '12 at 18:18