In the past I successfully created Qt5 static builds for windows. This time I'm trying to build the latest Qt5 as a dynamic build, but the resulting build is not functional, specifically:
if I use it for a QtCreator kit, and use said kit to run my application from within QtCreator, the application crashes at start with an error that it cannot find suitable platform plugin
if I copy all the dlls and the plugins directory into my application build directory and run it from the command prompt, the application still crash at start, this time without any meaningful error message (debugging plugins via envvar shows that all relevant plugins are found).
The configure command I used, before nmake
and nmake install
, is
C:\Qt5\qt5\bin\release>..\..\configure.bat -v -release -opensource -nomake examples -nomake tests -platform
win32-msvc -opengl desktop -openssl -openssl-linked -I C:\Qt\Tools\OpenSSL_1.1\Win_x64\include -LC:\Qt\Tools\OpenSSL_1.1\Win_x64\lib -
recheck-all -skip qtpurchasing -qt-doubleconversion -qt-pcre -qt-zlib -qt-harfbuzz -qt-libpng -qt-libjpeg -qt-sqlite -
feature-location-labs-plugin -feature-webengine-proprietary-codecs -no-feature-webengine-developer-build -no-feature-
webengine-system-ninja -webengine-jumbo-build 0
Note: the compilation of both Qt5 and of my app with this Qt5 build succeeds.
Also, note that on the same system the application is successfully built and run using the Qt company's online installer 5.15.2 version through QtCreator.
Update 19.08.24:
I have now tested both a prefix build with a conventional prefix (c:\foo) and a prefix build with -prefix %CD%\qtbase
. However, both builds fail in the same way when used from within QtCreator through a kit.
Is there something wrong or missing in my configure line that makes it disfunctional? From what I can tell, i am not using a prefix (does this make a difference? nmake install
installs it into C:\Qt\Qt-5.15.14
) and the build has no qt.conf as output. But I'm not sure to what extent this affects the build..
Alternately, could someone provide a configure line that would build dynamic Qt5 and run alright on windows(7)?
It just so turns out that my configure line is apparently correct. However, for whatever reason(1), using the resulting build from within QtCreator kept failing.
Building the application from the command line, instead, using the qmake from that build directory, produces a working binary. I have no idea how QtCreator gets it wrong (i tried version 4.13, 4.15 and 5.0.3), but at least i have solved my problem and can build the application now.
(1) https://doc.qt.io/qt-5/windows-building.html#step-3-set-the-environment-variables