Cannot build static Qt6 from source.
-
In order to build I use this .cmd file :
SET VS_ENVIRONMENT="C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat" SET SRC_DIR="C:\Qt\6.4.2\Src" SET BUILD_DIR="C:\Qt\6.4.2\Build2" SET INSTALL_DIR="C:\Qt\6.4.2.msvc2019_64_static_size" SET CONFIGURE_OPTIONS=-debug-and-release -top-level -mp -opensource -confirm-license -static -static-runtime -optimize-size call %VS_ENVIRONMENT% mkdir %BUILD_DIR% mkdir %INSTALL_DIR% cd %BUILD_DIR% call %SRC_DIR%\configure -prefix %INSTALL_DIR% %CONFIGURE_OPTIONS% cmake --build . --parallel cmake --install . cmake --install . --config Debug cd %INSTALL_DIR% rmdir %BUILD_DIR% /Q /S pauseWhen I executed this in Developer Command Prompt for VS 2022 output is :
C:\Qt\6.4.2\Build2>call "C:\Qt\6.4.2\Src"\configure -prefix "C:\Qt\6.4.2.msvc2019_64_static_size" -debug-and-release -top-level -mp -opensource -confirm-license -static -static-runtime -optimize-size + cd qtbase + C:\Qt\6.4.2\Src\qtbase\configure.bat -top-level -prefix "C:\Qt\6.4.2.msvc2019_64_static_size" -debug-and-release -top-level -mp -opensource -confirm-license -static -static-runtime -optimize-size -- Windows 10 SDK version: 10.0.22621.0 'C:/Program Files/CMake/bin/cmake.exe' '-DBUILD_SHARED_LIBS=OFF' '-DCMAKE_INSTALL_PREFIX=C:/Qt/6.4.2.msvc2019_64_static_size' '-DCMAKE_CONFIGURATION_TYPES=Release;Debug' '-DINPUT_msvc_mp=yes' '-DINPUT_static_runtime=yes' '-DINPUT_optimize_size=yes' '-G' 'Ninja Multi-Config' 'C:/Qt/6.4.2/Src' -- The CXX compiler identification is MSVC 19.33.31630.0 -- The C compiler identification is MSVC 19.33.31630.0 -- The ASM compiler identification is MSVC -- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done Checking dependencies of submodule 'qtbase' Checking dependencies of submodule 'qtimageformats' Checking dependencies of submodule 'qtlanguageserver' Checking dependencies of submodule 'qtshadertools' Checking dependencies of submodule 'qtsvg' Checking dependencies of submodule 'qtdeclarative' Checking dependencies of submodule 'qtquicktimeline' Checking dependencies of submodule 'qtquick3d' Checking dependencies of submodule 'qtmultimedia' Checking dependencies of submodule 'qt3d' Checking dependencies of submodule 'qt5compat' Checking dependencies of submodule 'qtactiveqt' Checking dependencies of submodule 'qtcharts' Checking dependencies of submodule 'qtcoap' Checking dependencies of submodule 'qtconnectivity' Checking dependencies of submodule 'qtdatavis3d' Checking dependencies of submodule 'qtwebsockets' Checking dependencies of submodule 'qthttpserver' Checking dependencies of submodule 'qttools' Checking dependencies of submodule 'qtdoc' Checking dependencies of submodule 'qtlottie' Checking dependencies of submodule 'qtmqtt' Checking dependencies of submodule 'qtnetworkauth' Checking dependencies of submodule 'qtopcua' Checking dependencies of submodule 'qtserialport' Checking dependencies of submodule 'qtpositioning' Checking dependencies of submodule 'qtquick3dphysics' Checking dependencies of submodule 'qtremoteobjects' Checking dependencies of submodule 'qtscxml' Checking dependencies of submodule 'qtsensors' Checking dependencies of submodule 'qtserialbus' Checking dependencies of submodule 'qtspeech' Checking dependencies of submodule 'qttranslations' Checking dependencies of submodule 'qtvirtualkeyboard' Checking dependencies of submodule 'qtwayland' Checking dependencies of submodule 'qtwebchannel' Checking dependencies of submodule 'qtwebengine' Checking dependencies of submodule 'qtwebview' Configuring submodule 'qtbase' CMake Error at C:/Qt/6.4.2/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:965 (message): CMake exited with code Access violation. -
In order to build I use this .cmd file :
SET VS_ENVIRONMENT="C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat" SET SRC_DIR="C:\Qt\6.4.2\Src" SET BUILD_DIR="C:\Qt\6.4.2\Build2" SET INSTALL_DIR="C:\Qt\6.4.2.msvc2019_64_static_size" SET CONFIGURE_OPTIONS=-debug-and-release -top-level -mp -opensource -confirm-license -static -static-runtime -optimize-size call %VS_ENVIRONMENT% mkdir %BUILD_DIR% mkdir %INSTALL_DIR% cd %BUILD_DIR% call %SRC_DIR%\configure -prefix %INSTALL_DIR% %CONFIGURE_OPTIONS% cmake --build . --parallel cmake --install . cmake --install . --config Debug cd %INSTALL_DIR% rmdir %BUILD_DIR% /Q /S pauseWhen I executed this in Developer Command Prompt for VS 2022 output is :
C:\Qt\6.4.2\Build2>call "C:\Qt\6.4.2\Src"\configure -prefix "C:\Qt\6.4.2.msvc2019_64_static_size" -debug-and-release -top-level -mp -opensource -confirm-license -static -static-runtime -optimize-size + cd qtbase + C:\Qt\6.4.2\Src\qtbase\configure.bat -top-level -prefix "C:\Qt\6.4.2.msvc2019_64_static_size" -debug-and-release -top-level -mp -opensource -confirm-license -static -static-runtime -optimize-size -- Windows 10 SDK version: 10.0.22621.0 'C:/Program Files/CMake/bin/cmake.exe' '-DBUILD_SHARED_LIBS=OFF' '-DCMAKE_INSTALL_PREFIX=C:/Qt/6.4.2.msvc2019_64_static_size' '-DCMAKE_CONFIGURATION_TYPES=Release;Debug' '-DINPUT_msvc_mp=yes' '-DINPUT_static_runtime=yes' '-DINPUT_optimize_size=yes' '-G' 'Ninja Multi-Config' 'C:/Qt/6.4.2/Src' -- The CXX compiler identification is MSVC 19.33.31630.0 -- The C compiler identification is MSVC 19.33.31630.0 -- The ASM compiler identification is MSVC -- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done Checking dependencies of submodule 'qtbase' Checking dependencies of submodule 'qtimageformats' Checking dependencies of submodule 'qtlanguageserver' Checking dependencies of submodule 'qtshadertools' Checking dependencies of submodule 'qtsvg' Checking dependencies of submodule 'qtdeclarative' Checking dependencies of submodule 'qtquicktimeline' Checking dependencies of submodule 'qtquick3d' Checking dependencies of submodule 'qtmultimedia' Checking dependencies of submodule 'qt3d' Checking dependencies of submodule 'qt5compat' Checking dependencies of submodule 'qtactiveqt' Checking dependencies of submodule 'qtcharts' Checking dependencies of submodule 'qtcoap' Checking dependencies of submodule 'qtconnectivity' Checking dependencies of submodule 'qtdatavis3d' Checking dependencies of submodule 'qtwebsockets' Checking dependencies of submodule 'qthttpserver' Checking dependencies of submodule 'qttools' Checking dependencies of submodule 'qtdoc' Checking dependencies of submodule 'qtlottie' Checking dependencies of submodule 'qtmqtt' Checking dependencies of submodule 'qtnetworkauth' Checking dependencies of submodule 'qtopcua' Checking dependencies of submodule 'qtserialport' Checking dependencies of submodule 'qtpositioning' Checking dependencies of submodule 'qtquick3dphysics' Checking dependencies of submodule 'qtremoteobjects' Checking dependencies of submodule 'qtscxml' Checking dependencies of submodule 'qtsensors' Checking dependencies of submodule 'qtserialbus' Checking dependencies of submodule 'qtspeech' Checking dependencies of submodule 'qttranslations' Checking dependencies of submodule 'qtvirtualkeyboard' Checking dependencies of submodule 'qtwayland' Checking dependencies of submodule 'qtwebchannel' Checking dependencies of submodule 'qtwebengine' Checking dependencies of submodule 'qtwebview' Configuring submodule 'qtbase' CMake Error at C:/Qt/6.4.2/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:965 (message): CMake exited with code Access violation.What cmake version do you use? Looks like cmake has some problems. Try upgrading to the latest version.
-
In order to build I use this .cmd file :
SET VS_ENVIRONMENT="C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat" SET SRC_DIR="C:\Qt\6.4.2\Src" SET BUILD_DIR="C:\Qt\6.4.2\Build2" SET INSTALL_DIR="C:\Qt\6.4.2.msvc2019_64_static_size" SET CONFIGURE_OPTIONS=-debug-and-release -top-level -mp -opensource -confirm-license -static -static-runtime -optimize-size call %VS_ENVIRONMENT% mkdir %BUILD_DIR% mkdir %INSTALL_DIR% cd %BUILD_DIR% call %SRC_DIR%\configure -prefix %INSTALL_DIR% %CONFIGURE_OPTIONS% cmake --build . --parallel cmake --install . cmake --install . --config Debug cd %INSTALL_DIR% rmdir %BUILD_DIR% /Q /S pauseWhen I executed this in Developer Command Prompt for VS 2022 output is :
C:\Qt\6.4.2\Build2>call "C:\Qt\6.4.2\Src"\configure -prefix "C:\Qt\6.4.2.msvc2019_64_static_size" -debug-and-release -top-level -mp -opensource -confirm-license -static -static-runtime -optimize-size + cd qtbase + C:\Qt\6.4.2\Src\qtbase\configure.bat -top-level -prefix "C:\Qt\6.4.2.msvc2019_64_static_size" -debug-and-release -top-level -mp -opensource -confirm-license -static -static-runtime -optimize-size -- Windows 10 SDK version: 10.0.22621.0 'C:/Program Files/CMake/bin/cmake.exe' '-DBUILD_SHARED_LIBS=OFF' '-DCMAKE_INSTALL_PREFIX=C:/Qt/6.4.2.msvc2019_64_static_size' '-DCMAKE_CONFIGURATION_TYPES=Release;Debug' '-DINPUT_msvc_mp=yes' '-DINPUT_static_runtime=yes' '-DINPUT_optimize_size=yes' '-G' 'Ninja Multi-Config' 'C:/Qt/6.4.2/Src' -- The CXX compiler identification is MSVC 19.33.31630.0 -- The C compiler identification is MSVC 19.33.31630.0 -- The ASM compiler identification is MSVC -- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done Checking dependencies of submodule 'qtbase' Checking dependencies of submodule 'qtimageformats' Checking dependencies of submodule 'qtlanguageserver' Checking dependencies of submodule 'qtshadertools' Checking dependencies of submodule 'qtsvg' Checking dependencies of submodule 'qtdeclarative' Checking dependencies of submodule 'qtquicktimeline' Checking dependencies of submodule 'qtquick3d' Checking dependencies of submodule 'qtmultimedia' Checking dependencies of submodule 'qt3d' Checking dependencies of submodule 'qt5compat' Checking dependencies of submodule 'qtactiveqt' Checking dependencies of submodule 'qtcharts' Checking dependencies of submodule 'qtcoap' Checking dependencies of submodule 'qtconnectivity' Checking dependencies of submodule 'qtdatavis3d' Checking dependencies of submodule 'qtwebsockets' Checking dependencies of submodule 'qthttpserver' Checking dependencies of submodule 'qttools' Checking dependencies of submodule 'qtdoc' Checking dependencies of submodule 'qtlottie' Checking dependencies of submodule 'qtmqtt' Checking dependencies of submodule 'qtnetworkauth' Checking dependencies of submodule 'qtopcua' Checking dependencies of submodule 'qtserialport' Checking dependencies of submodule 'qtpositioning' Checking dependencies of submodule 'qtquick3dphysics' Checking dependencies of submodule 'qtremoteobjects' Checking dependencies of submodule 'qtscxml' Checking dependencies of submodule 'qtsensors' Checking dependencies of submodule 'qtserialbus' Checking dependencies of submodule 'qtspeech' Checking dependencies of submodule 'qttranslations' Checking dependencies of submodule 'qtvirtualkeyboard' Checking dependencies of submodule 'qtwayland' Checking dependencies of submodule 'qtwebchannel' Checking dependencies of submodule 'qtwebengine' Checking dependencies of submodule 'qtwebview' Configuring submodule 'qtbase' CMake Error at C:/Qt/6.4.2/Src/qtbase/cmake/QtProcessConfigureArgs.cmake:965 (message): CMake exited with code Access violation.Hi and welcome to devnet,
Did you also try with the CMake provided with Qt ?
-
I tried but error message was same. As @Christian-Ehrlicher said, I was using cmake version 3.24.0-rc3. After upgrading the version to cmake version 3.26.0-rc5(latest) it fixed. Thank you for your time
-
F FulLT has marked this topic as solved on