I'm porting my applications to Qt6, from 5.15. Still using qmake. My console applications build and run fine, but my widgets applications fail to link with an error (Windows, VS 2022):

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

I have a traditional entrypoint: int main(int argc, char* argv[]).


I see in Qt 5 there was a magic helper library qtmain, but this does not exist in Qt 6.

If I add the linker flag /ENTRY:mainCRTStartup then it builds. What's the correct Qt solution for this though?


Thanks

Hamish

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to