Qt 6 undefined reference to WinMain on MinGW
-
I'm running into this in windows. I've been looking at the qmake -d 2>&1 of a Qt example vs a QWT example. At some point in the QWT qmake generation it seems to loose the entrypoint_private module.
qt example: DEBUG 1: C:/tools/Qt/6.4.2/msvc2019_64/mkspecs/features/qt_functions.prf:379: modules := core gui entrypoint_private
qwt example: DEBUG 1: C:/tools/Qt/6.4.2/msvc2019_64/mkspecs/features/qt_functions.prf:379: modules := core gui printsupport concurrent opengl openglwidgets svgI haven't been able to figure out the clean fix yet. I ended up diffing the makefiles between the examples and one the major differences was that the QWT example was missing the lib: Qt6EntryPoint.lib
So I added it to the qwt example pro like:
LIBS += C:\Qt\6.4.2\msvc2019_64\lib\Qt6EntryPoint.liband then the release version at least built successfully.
note: for diffing the qmake -d output it's handy to do a cut like this (powershell):
qmake -d 2>&1 | % { $_ -split ':' | select -last 1 }this strips out a lot of paths making the diff easier to scan.
This was using Qwt 6.2.0, git sha:92baef.