Solved Static compile of Qt Charts
-
Great, thanks for your replies!
-
I have come across the same problem. I have a fully working dynamic build but have now tried a static build of Qt. However, after successfully building Qt statically and try to run, I get the following error:
:-1: error: Unknown module(s) in QT: charts datavisualization help
Apologies if this is a basic question, but could you please explain (for dummies) how to "build the module by hand"?
Edit: to complete a static build, I ran:
configure -opensource -confirm-license -static -platform win32-g++ -opengl desktop -prefix "C:\Qt\5.12.6\mingw73_64_static" -skip webengine -nomake tests -nomake examples ... mingw32-make ... mingw32-make install ... mingw32-make clean
-
@AhmedAlshawi hi, if you don't have QtCharts as part of your sources, you have to first download it.
Then the classic qmake/make/make install applies. Note that I recommend using out of source builds.
-
@SGaist Thanks for the quick reply. I must admit I do not understand what the 'classic qmake/make/make install' means.
I downloaded the sources package as part of the installation for Qt, and within my sources folder 'Src' I do have the 'qtcharts' folder, but I do not have 'qthelp' or 'qtdatavisualisation' in the folder.
To build, should I copy the 'qtcharts' folder out of 'Src' and then build it? and how do I 'build' it?
Thanks a lot!
-
No, the idea is to create a folder outside of the source tree and do the build there.
For example:
mkdir -p /Users/jedd/build/qtcharts cd /Users/jedd/build/qtcharts /path/to/your/self_built/Qt/bin/qmake /path/to/qtcharts make make install
-
@SGaist So I followed the steps exactly and I get an error that 'make' can't be found.
Here are the lines added into PATH
Thank you :)
-
I wrote for a *nix OS.
In your case it's "mingw32-make".
-
@SGaist Amazing thank you!! Worked a treat!
I now still get 'datavisualization' and 'help' as unknown modules, but I can't find these in the 'Src' folder. Can I download them separately or are they hidden somewhere?
Also, when I try and build my project using this static build, I have added "CONFIG += static" to the .pro file, but get these two errors:
- :-1: error: Cannot find windeployqt.exe in "C:\Qt\5.12.6\mingw73_64_static\bin".
- Cannot find winrtrunner.exe in "C:\Qt\5.12.6\mingw73_64_static\bin"
Any help is much appreciated. Cheers.
-
The help module likely comes from qttools as well as windeployqt.
All the sources should be available from the installer, but if not, then you can clone them from https://code.qt.io
-
@SGaist
Thank you so much, I built qttools in the same way and it fixed my problem completely!