Posted on

Qt project linker error for unresolved external symbol WinMain

Have you even received the following error after adding Qt to your Visual Studio project? The fix is easy but not what you would expect.

MSVCRTD.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function “int __cdecl invoke_main(void)” (?invoke_main@@YAHXZ)

To fix it, Open Properties for the project then go to Linker -> System and change the SubSystem to Not Set from the drop down list. Make sure you do this for All Configurations.

That’s it. Back to work!