I am building a Windows application based on Qt using VisualStudio 2017 Professional (15.9.35) and the Qt VS Tools add-on. The project compiled fine up to a certain point, now the linker gives the error:
10>MSVCRTD.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
The target Qt version is Qt-5.12.10-msvc2017-32 (my application is 32-bit). My application defines main(), I expect WinMain to be defined by Qt which in turn will call my main() (as stated here, it worked at earlier stages of the development)
What I've checked (in the project for the application, and also in the dependency libraries project that are in the same VS solution):
- Qt modules: core;gui;testlib;widgets
- Subsystem: Windows (/SUBSYSTEM:WINDOWS)
- Character Set: blank (it's not either "Not set", it's set that way by the Qt VS Tools add-on when first creating a project)
- Treat wchar_t as built-in type: Yes (/Zc:wchar_t)