Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
Building Qt for static linking on Windows. Quick and Qml are missing? How to link plugins statically?
rmdev last edited by
I'm having a few problems trying to get Qt to statically link the libraries. I've searched the internet and the forum for the past days, but couldn't find a solution that worked. Maybe there is a problem in the way I am building it and I hope someone can help me out.
I have downloaded the qt-everywhere-opensource-src-126.96.36.199z package and unzipped it to C:\Qt\QtStatic\
Since I have Qt Creator 5.2.1 installed already, I've set the PATH variable to point to C:\Qt\Qt5.2.1\Tools\mingw48_32\bin for mingw32-make
I open the command windows and navigate to C:\Qt\QtStatic\
From there I run configure.bat with the following options:
configure -static -platform win32-g++ -opengl desktop -nomake examples -nomake tests -opensource
When that's done:
Now I start up the Qt Creator and open the "Qt Quick Controls - Gallery" example.
I then go to Projects and create a Kit that's linking to the qmake located in the static build I made above.
I then notice that it already gives me a warning saying: qmlscene is not installed, no qmlviewer installed.
I select the new kit to be the current setting for compilation and try to build the application and then get the following error in build problems:
Unknown module(s) in QT: quick qml
Now my question is, how can I get the project to find those? Do I need to build the library again with other settings? Do I add quick and qml elsewhere?
rmdev last edited by
It seems to work now. Here's what I did:
I now added a reference to Python to the PATH-variable and recompiled the whole thing with added configure options:
configure -static -platform win32-g++ -opengl desktop -nomake examples -nomake tests -opensource -debug-and-release -developer-builld
Then I only used mingw32-make
No need for mingw32-make install
Static linking seems to work now, apart from the plugins.
I haven't found out how to tell the project to also put stuff like platforms/qwindows.dll and the QtQuick and QtQuick.2 folder into the executable as well.
So right now the application folder still looks like this:
QtQuick/..(a lot of stuff)
QtQuick.2/..(a lot of stuff)
mib383 last edited by
I have the same problem with plugins.