I cannot configure Qt 6.2.0 to build statically. Errors: "opt: zlib val: qt", "Overriding option 'libpng' with 'qt' (was: 'undefined')" and so on
-
Hello,
I try to configure Qt6 to build statically. I use this configuration command:
configure -prefix "C:\Qt\Qt6.2.0_MinGW_Static" -static -static-runtime -release -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -sql-odbc -sql-sqlite -nomake tools -nomake examples -nomake tests -no-angle -skip qttools -skip qtquick3d -skip qt5compat -skip qtshadertools -skip qtquicktimeline -skip qtwebengine -skip qtactiveqt -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtimageformats -skip qtlottie -skip qtnetworkauth -skip qtremoteobjects -skip qtvirtualkeyboard -skip qtserialbus -skip qtserialport -skip qtwebchannel -skip qtwebview -skip qtwayland -skip qtscxml -skip qtmqtt -skip qtopcua -skip qtsvg -skip qtdoc
But this configuration give me these errors:
opt: zlib val: qt opt: pcre val: qt opt: libpng val: qt Overriding option 'libpng' with 'qt' (was: 'undefined') opt: libjpeg val: qt Overriding option 'libjpeg' with 'qt' (was: 'undefined') opt: freetype val: qt Overriding option 'freetype' with 'qt' (was: 'undefined') CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:251 (message): Unknown command line option '-no-angle'. Call Stack (most recent call first): qtbase/cmake/QtProcessConfigureArgs.cmake:645 (qtConfAddError)
I tried to install CMake 3.21.3 x386 and CMake 3.21.3 x86_64
-
Hi,
From the looks of it, you should drop the -no-angle option.
-
I deleted
-no-angle
:configure -prefix "C:\Qt6.2.0_Static" -static -static-runtime -release -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -sql-odbc -sql-sqlite -nomake tools -nomake examples -nomake tests -skip qttools -skip qtquick3d -skip qt5compat -skip qtshadertools -skip qtquicktimeline -skip qtwebengine -skip qtactiveqt -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtimageformats -skip qtlottie -skip qtnetworkauth -skip qtremoteobjects -skip qtvirtualkeyboard -skip qtserialbus -skip qtserialport -skip qtwebchannel -skip qtwebview -skip qtwayland -skip qtscxml -skip qtmqtt -skip qtopcua -skip qtsvg -skip qtdoc
I have this error:
Checking dependencies of 'qtmultimedia' CMake Error at CMakeLists.txt:81 (message): Module 'qtmultimedia' depends on 'qtshadertools', but building 'qtshadertools' was explicitly disabled. Note: Use '-skip qtmultimedia' to exclude it from the build. -- Configuring incomplete, errors occurred!
I deleted
-skip qtshadertools
:configure -prefix "C:\Qt6.2.0_Static" -static -static-runtime -release -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -sql-odbc -sql-sqlite -nomake tools -nomake examples -nomake tests -skip qttools -skip qtquick3d -skip qt5compat -skip qtquicktimeline -skip qtwebengine -skip qtactiveqt -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtimageformats -skip qtlottie -skip qtnetworkauth -skip qtremoteobjects -skip qtvirtualkeyboard -skip qtserialbus -skip qtserialport -skip qtwebchannel -skip qtwebview -skip qtwayland -skip qtscxml -skip qtmqtt -skip qtopcua -skip qtsvg -skip qtdoc
But I have the same error. How to clean the configuration? I use MinGW.
-
How to clean the configuration?
I just deleted the "CMakeCache.txt" file. Now I have this error:
Checking dependencies of 'qttranslations' CMake Error at CMakeLists.txt:81 (message): Module 'qttranslations' depends on 'qttools', but building 'qttools' was explicitly disabled. Note: Use '-skip qttranslations' to exclude it from the build. -- Configuring incomplete, errors occurred!
I added
-skip qttranslations
:configure -prefix "C:\Qt6.2.0_Static" -static -static-runtime -release -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -sql-odbc -sql-sqlite -nomake tools -nomake examples -nomake tests -skip qttools -skip qtquick3d -skip qt5compat -skip qtquicktimeline -skip qtwebengine -skip qtactiveqt -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtimageformats -skip qtlottie -skip qtnetworkauth -skip qtremoteobjects -skip qtvirtualkeyboard -skip qtserialbus -skip qtserialport -skip qtwebchannel -skip qtwebview -skip qtwayland -skip qtscxml -skip qtmqtt -skip qtopcua -skip qtsvg -skip qtdoc -skip qttranslations
Configuration is running.
-
I have this error in 3 minutes:
-- Found WrapPCRE2: TRUE CMake Error at qtbase/cmake/QtSyncQtHelpers.cmake:7 (message): Perl needs to be available to build Qt. Call Stack (most recent call first): qtbase/cmake/QtSyncQtHelpers.cmake:12 (qt_ensure_perl) qtbase/cmake/QtModuleHelpers.cmake:285 (qt_ensure_sync_qt) qtbase/src/corelib/CMakeLists.txt:33 (qt_internal_add_module) -- Configuring incomplete, errors occurred! See also "C:/Temp/qt-everywhere-src-6.2.0/CMakeFiles/CMakeOutput.log". See also "C:/Temp/qt-everywhere-src-6.2.0/CMakeFiles/CMakeError.log". CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:947 (message): CMake exited with code 1.
I will try to setup Perl.
-
I installed Perl using this link: https://doc.qt.io/qt-6/windows-building.html
I used
ActiveState Perl
but I have the same error above thatPerl needs to be available to build Qt.
I reopend CMD but
perl
is not available:I download "Strawberry Perl" from here: https://strawberryperl.com/ I installed
strawberry-perl-5.32.1.1-64bit.msi
. It requires 542 MB on hard disc.Perl is available now:
-
Configuration was done! It requires 7 minutes on my laptop.
-
Some information for people who will build Qt6 to static.
This command does not work for me:
cmake --build . --parallel
:[ 7%] Built target 3DQuickInput_lib_pri [ 7%] Built target Bundled_Clip2Tri_ext_pri [ 7%] Built target PositioningQuick_lib_pri [ 7%] Built target 3DInput_lib_pri [ 7%] [ 7%] Built target 3DRender_lib_pri Built target 3DQuickAnimation_lib_pri mingw32-make.exe[2]: *** [qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\build.make:571: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/kernel/qcoreapplication.cpp.obj] Error 1 mingw32-make.exe[2]: *** [qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\build.make:586: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/kernel/qcoreglobaldata.cpp.obj] Error 1 mingw32-make.exe[2]: *** [qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\build.make:616: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/kernel/qmetacontainer.cpp.obj] Error 1 mingw32-make.exe[2]: *** [qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\build.make:631: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/kernel/qmetatype.cpp.obj] Error 1 mingw32-make.exe[2]: *** [qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\build.make:646: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/kernel/qsharedmemory.cpp.obj] Error 1 mingw32-make.exe[2]: *** [qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\build.make:661: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/kernel/qsystemerror.cpp.obj] Error 1 mingw32-make.exe[2]: *** [qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\build.make:676: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/kernel/qsystemsemaphore.cpp.obj] Error -1073741523 mingw32-make.exe[2]: *** [qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\build.make:691: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/kernel/qvariant.cpp.obj] Error -1073741523 mingw32-make.exe[2]: *** [qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\build.make:706: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/plugin/quuid.cpp.obj] Error 1 mingw32-make.exe[2]: *** [qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\build.make:721: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/serialization/qcborcommon.cpp.obj] Error -1073741523 mingw32-make.exe[2]: *** [qtbase\src\tools\bootstrap\CMakeFiles\Bootstrap.dir\build.make:736: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/serialization/qcborstreamwriter.cpp.obj] Error -1073741523 [ 7%] Built target EntryPointImplementation mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:6543: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/all] Error 2 mingw32-make.exe: *** [Makefile:145: all] Error 2
I used
mingw32-make
andmingw32-make install
.mingw32-make
requires ~ 7 hours and ~30 GB on hard drive:I temporarily removed almost all programs from the C drive on my laptop: Chrome, Antivirus, VSCode, and so on.
If it is not enough space you can run
mingw32-make
again:mingw32-make install
creates the "Qt6.2.0_Static" folder with size = 822 MB. -
I have this problem for settings: Qt version is not properly installed, please run make install