Building Qt 6.1.2 under windows says perl is missing when in fact it isn't
-
I am trying to build Qt 6.1.2 from sources under windows, using visual studio 2019, but I can't get it to work at all for some reason.
This is the setup I am using to run configure:
As you can see cmake, ninja, python, perl and licheck (the one from qt sources in qtbase/bin) are all available to the shell. After several seconds, configure script fails with a rather cryptic message:
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:194 (qt_ensure_sync_qt) qtbase/src/corelib/CMakeLists.txt:29 (qt_internal_add_module) -- Configuring incomplete, errors occurred! See also "C:/Qt/6.1.2/build_x32/out/CMakeFiles/CMakeOutput.log". See also "C:/Qt/6.1.2/build_x32/out/CMakeFiles/CMakeError.log". CMake Error at C:/Qt/6.1.2/src/qtbase/cmake/QtProcessConfigureArgs.cmake:828 (message): CMake exited with code 1.
Here is the full log in text format:
c:\Qt\6.1.2\build_x32\out>cmake --version cmake version 3.20.21032501-MSVC_2 CMake suite maintained and supported by Kitware (kitware.com/cmake). c:\Qt\6.1.2\build_x32\out>ninja --version 1.10.2 c:\Qt\6.1.2\build_x32\out>perl --version This is perl 5, version 32, subversion 1 (v5.32.1) built for MSWin32-x64-multi-thread Copyright 1987-2021, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. c:\Qt\6.1.2\build_x32\out>python --version Python 3.5.1 c:\Qt\6.1.2\build_x32\out>cl Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30133 for x86 Copyright (C) Microsoft Corporation. All rights reserved. usage: cl [ option... ] filename... [ /link linkoption... ] c:\Qt\6.1.2\build_x32\out>licheck --version Licheck version: 415f6cde c:\Qt\6.1.2\build_x32\out>c:\Qt\6.1.2\src\configure.bat -top-level -debug-and-release -platform win32-msvc -opensource -confirm-license -skip webengine -nomake tools -nomake examples -nomake tests -opengl desktop -force-debug-info -optimize-size -no-pch -make-tool jom -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype + cd qtbase + c:\Qt\6.1.2\src\qtbase\configure.bat -top-level -top-level -debug-and-release -platform win32-msvc -opensource -confirm-license -skip webengine -nomake tools -nomake examples -nomake tests -opengl desktop -force-debug-info -optimize-size -no-pch -make-tool jom -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype 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 Warning at C:/Qt/6.1.2/src/qtbase/cmake/QtProcessConfigureArgs.cmake:228 (message): '-nomake tools' is not implemented yet. Call Stack (most recent call first): C:/Qt/6.1.2/src/qtbase/cmake/QtProcessConfigureArgs.cmake:667 (qtConfAddWarning) C:/Qt/6.1.2/src/qtbase/cmake/QtProcessConfigureArgs.cmake:732 (check_qt_build_parts) 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe' '-DBUILD_webengine=OFF' '-DBUILD_WITH_PCH=OFF' '-DQT_QMAKE_TARGET_MKSPEC=win32-msvc' '-DQT_BUILD_EXAMPLES=FALSE' '-DQT_BUILD_TESTS=FALSE' '-DCMAKE_CONFIGURATION_TYPES=RelWithDebInfo;Debug' '-DINPUT_opengl=desktop' '-DINPUT_optimize_size=yes' '-DINPUT_make_tool=jom' '-DINPUT_system_zlib=no' '-DINPUT_pcre=qt' '-DINPUT_libpng=qt' '-DINPUT_libjpeg=qt' '-DINPUT_freetype=qt' '-G' 'Ninja Multi-Config' 'C:/Qt/6.1.2/src' -- The CXX compiler identification is MSVC 19.29.30133.0 -- The C compiler identification is MSVC 19.29.30133.0 -- The ASM compiler identification is MSVC -- Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/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 (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done Check dependencies of 'qtbase' Check dependencies of 'qtshadertools' Check dependencies of 'qtsvg' Check dependencies of 'qtdeclarative' Check dependencies of 'qt3d' Check dependencies of 'qt5compat' Check dependencies of 'qtactiveqt' Check dependencies of 'qtcharts' Check dependencies of 'qttools' Check dependencies of 'qtcoap' Check dependencies of 'qtdatavis3d' Check dependencies of 'qtimageformats' Check dependencies of 'qtquickcontrols2' Check dependencies of 'qtdoc' Check dependencies of 'qtlottie' Check dependencies of 'qtmqtt' Check dependencies of 'qtnetworkauth' Check dependencies of 'qtopcua' Check dependencies of 'qtquick3d' Check dependencies of 'qtquicktimeline' Check dependencies of 'qtscxml' Check dependencies of 'qttranslations' Check dependencies of 'qtvirtualkeyboard' Check dependencies of 'qtwayland' Configuring 'qtbase' -- Building for multiple configurations: RelWithDebInfo;Debug. -- Main configuration is: RelWithDebInfo. -- Check for feature set changes -- Extracting architecture info from C:/Qt/6.1.2/build_x32/out/qtbase/config.tests/arch/RelWithDebInfo/architecture_test.exe. -- Performing Test HAVE_LD_VERSION_SCRIPT -- Performing Test HAVE_LD_VERSION_SCRIPT - Failed -- CMAKE_VERSION: "3.20.21032501-MSVC_2" -- CMAKE_HOST_SYSTEM: "Windows-10.0.19043" -- CMAKE_HOST_SYSTEM_NAME: "Windows" -- CMAKE_HOST_SYSTEM_VERSION: "10.0.19043" -- CMAKE_HOST_SYSTEM_PROCESSOR: "AMD64" -- CMAKE_SYSTEM: "Windows" -- CMAKE_SYSTEM_NAME: "Windows" -- CMAKE_SYSTEM_VERSION: "10.0.19043" -- CMAKE_SYSTEM_PROCESSOR: "AMD64" -- CMAKE_CROSSCOMPILING: "FALSE" -- CMAKE_C_COMPILER: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe" (19.29.30133.0) -- CMAKE_CXX_COMPILER: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe" (19.29.30133.0) -- MSVC_VERSION: "1929" -- MSVC_TOOLSET_VERSION: "142" -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) (Required is at least version "1.0.8") -- Could NOT find WrapZLIB (missing: WrapZLIB_FOUND) (Required is at least version "1.0.8") -- Could NOT find ZSTD: Found unsuitable version "", but required is at least "1.3" (found ZSTD_LIBRARY-NOTFOUND) -- Could NOT find WrapDBus1 (missing: DBus1_LIBRARY DBus1_INCLUDE_DIR WrapDBus1_FOUND) (Required is at least version "1.2") -- Performing Test HAVE_cxx14 -- Performing Test HAVE_cxx14 - Success -- Performing Test HAVE_cxx17 -- Performing Test HAVE_cxx17 - Success -- Performing Test HAVE_cxx20 -- Performing Test HAVE_cxx20 - Success -- Performing Test HAVE_precompile_header -- Performing Test HAVE_precompile_header - Failed -- Performing Test TEST_use_bfd_linker -- Performing Test TEST_use_bfd_linker - Failed -- Performing Test TEST_use_gold_linker -- Performing Test TEST_use_gold_linker - Failed -- Performing Test TEST_use_lld_linker -- Performing Test TEST_use_lld_linker - Failed -- Performing Test TEST_optimize_debug -- Performing Test TEST_optimize_debug - Success -- Performing Test TEST_enable_new_dtags -- Performing Test TEST_enable_new_dtags - Success -- Performing Test TEST_gdb_index -- Performing Test TEST_gdb_index - Success -- Performing Test HAVE_reduce_relocations -- Performing Test HAVE_reduce_relocations - Failed -- Performing Test separate debug information support -- Performing Test separate debug information support - Failed -- Performing Test HAVE_signaling_nan -- Performing Test HAVE_signaling_nan - Success -- Performing SIMD Test SSE2 instructions -- Performing SIMD Test SSE2 instructions - Success -- Performing SIMD Test SSE3 instructions -- Performing SIMD Test SSE3 instructions - Success -- Performing SIMD Test SSSE3 instructions -- Performing SIMD Test SSSE3 instructions - Success -- Performing SIMD Test SSE4.1 instructions -- Performing SIMD Test SSE4.1 instructions - Success -- Performing SIMD Test SSE4.2 instructions -- Performing SIMD Test SSE4.2 instructions - Success -- Performing SIMD Test AES new instructions -- Performing SIMD Test AES new instructions - Success -- Performing SIMD Test F16C instructions -- Performing SIMD Test F16C instructions - Success -- Performing SIMD Test RDRAND instruction -- Performing SIMD Test RDRAND instruction - Success -- Performing SIMD Test RDSEED instruction -- Performing SIMD Test RDSEED instruction - Success -- Performing SIMD Test SHA new instructions -- Performing SIMD Test SHA new instructions - Success -- Performing SIMD Test AVX instructions -- Performing SIMD Test AVX instructions - Success -- Performing SIMD Test AVX2 instructions -- Performing SIMD Test AVX2 instructions - Success -- Performing SIMD Test AVX512 F instructions -- Performing SIMD Test AVX512 F instructions - Success -- Performing SIMD Test AVX512 ER instructions -- Performing SIMD Test AVX512 ER instructions - Success -- Performing SIMD Test AVX512 CD instructions -- Performing SIMD Test AVX512 CD instructions - Success -- Performing SIMD Test AVX512 PF instructions -- Performing SIMD Test AVX512 PF instructions - Success -- Performing SIMD Test AVX512 DQ instructions -- Performing SIMD Test AVX512 DQ instructions - Success -- Performing SIMD Test AVX512 BW instructions -- Performing SIMD Test AVX512 BW instructions - Success -- Performing SIMD Test AVX512 VL instructions -- Performing SIMD Test AVX512 VL instructions - Success -- Performing SIMD Test AVX512 IFMA instructions -- Performing SIMD Test AVX512 IFMA instructions - Success -- Performing SIMD Test AVX512 VBMI instructions -- Performing SIMD Test AVX512 VBMI instructions - Success -- Performing Test HAVE_posix_fallocate -- Performing Test HAVE_posix_fallocate - Failed -- Performing Test HAVE_alloca_stdlib_h -- Performing Test HAVE_alloca_stdlib_h - Failed -- Performing Test HAVE_alloca_h -- Performing Test HAVE_alloca_h - Failed -- Performing Test HAVE_alloca_malloc_h -- Performing Test HAVE_alloca_malloc_h - Success -- Performing Test HAVE_stack_protector -- Performing Test HAVE_stack_protector - Success -- Performing Test HAVE_intelcet -- Performing Test HAVE_intelcet - Failed -- Could NOT find double-conversion (missing: double-conversion_DIR) -- Could NOT find WrapDoubleConversion (missing: WrapDoubleConversion_FOUND) -- Could NOT find GLIB2 (missing: GLIB2_LIBRARIES GTHREAD2_LIBRARIES GLIB2_INCLUDE_DIRS) -- Found the following ICU libraries: -- i18n (required) -- uc (required) -- data (required) -- Failed to find all ICU components (missing: ICU_INCLUDE_DIR) -- Performing Test HAVE_STDATOMIC -- Performing Test HAVE_STDATOMIC - Success -- Found WrapAtomic: TRUE -- Could NOT find Libb2 (missing: LIBB2_LIBRARY LIBB2_INCLUDE_DIR) -- Performing Test HAVE_GETTIME -- Performing Test HAVE_GETTIME - Failed -- Could NOT find WrapRt (missing: WrapRt_FOUND) -- Could NOT find LTTngUST (missing: LTTNGUST_LIBRARIES LTTNGUST_INCLUDE_DIRS) -- Could NOT find WrapSystemPCRE2 (missing: PCRE2_LIBRARIES PCRE2_INCLUDE_DIRS __pcre2_found) (Required is at least version "10.20") -- Could NOT find Slog2 (missing: Slog2_INCLUDE_DIR Slog2_LIBRARY) -- Performing Test HAVE_atomicfptr -- Performing Test HAVE_atomicfptr - Success -- Performing Test HAVE_cloexec -- Performing Test HAVE_cloexec - Failed -- Performing Test HAVE_cxx11_future -- Performing Test HAVE_cxx11_future - Success -- Performing Test HAVE_cxx11_random -- Performing Test HAVE_cxx11_random - Success -- Performing Test HAVE_cxx17_filesystem -- Performing Test HAVE_cxx17_filesystem - Success -- Performing Test HAVE_eventfd -- Performing Test HAVE_eventfd - Failed -- Performing Test HAVE_futimens -- Performing Test HAVE_futimens - Failed -- Performing Test HAVE_futimes -- Performing Test HAVE_futimes - Failed -- Performing Test HAVE_getauxval -- Performing Test HAVE_getauxval - Failed -- Performing Test HAVE_getentropy -- Performing Test HAVE_getentropy - Failed -- Performing Test HAVE_glibc -- Performing Test HAVE_glibc - Failed -- Performing Test HAVE_inotify -- Performing Test HAVE_inotify - Failed -- Performing Test HAVE_ipc_sysv -- Performing Test HAVE_ipc_sysv - Failed -- Performing Test HAVE_ipc_posix -- Performing Test HAVE_ipc_posix - Failed -- Performing Test HAVE_linkat -- Performing Test HAVE_linkat - Failed -- Performing Test HAVE_ppoll -- Performing Test HAVE_ppoll - Failed -- Performing Test HAVE_pollts -- Performing Test HAVE_pollts - Failed -- Performing Test HAVE_poll -- Performing Test HAVE_poll - Failed -- Performing Test HAVE_renameat2 -- Performing Test HAVE_renameat2 - Failed -- Performing Test HAVE_statx -- Performing Test HAVE_statx - Failed -- Performing Test HAVE_syslog -- Performing Test HAVE_syslog - Failed -- Performing Test HAVE_xlocalescanprint -- Performing Test HAVE_xlocalescanprint - Failed -- Could NOT find WrapBrotli (missing: BrotliDec_FOUND BrotliEnc_FOUND BrotliCommon_FOUND) -- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) -- Could NOT find WrapOpenSSLHeaders (missing: WrapOpenSSLHeaders_FOUND) -- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) -- Could NOT find WrapOpenSSLHeaders (missing: WrapOpenSSLHeaders_FOUND) -- Could NOT find WrapOpenSSL (missing: WrapOpenSSL_FOUND) -- Could NOT find GSSAPI (missing: GSSAPI_LIBRARIES GSSAPI_INCLUDE_DIRS) -- Performing Test HAVE_getifaddrs -- Performing Test HAVE_getifaddrs - Failed -- Performing Test HAVE_ipv6ifname -- Performing Test HAVE_ipv6ifname - Failed -- Performing Test HAVE_linux_netlink -- Performing Test HAVE_linux_netlink - Failed -- Performing Test HAVE_sctp -- Performing Test HAVE_sctp - Failed -- Performing Test HAVE_networklistmanager -- Performing Test HAVE_networklistmanager - Success -- FindLibdrm.cmake cannot find libdrm on Windows systems. -- Performing Test HAVE_EGL -- Performing Test HAVE_EGL - Failed -- Could NOT find EGL (missing: EGL_INCLUDE_DIR HAVE_EGL EGL_LIBRARY) -- Could NOT find WrapSystemFreetype (missing: __freetype_found) (Required is at least version "2.2.0") -- Could NOT find Fontconfig (missing: Fontconfig_LIBRARY Fontconfig_INCLUDE_DIR) -- Findgbm.cmake cannot find gbm on Windows systems. -- Could NOT find WrapSystemHarfbuzz (missing: HARFBUZZ_LIBRARIES HARFBUZZ_INCLUDE_DIRS) (Required is at least version "2.6.0") -- FindLibinput.cmake cannot find libinput on Windows systems. -- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR) -- Could NOT find WrapSystemPNG (missing: __png_found) -- Found OpenGL: opengl32 -- Found WrapOpenGL: TRUE -- Could NOT find EGL (missing: EGL_INCLUDE_DIR HAVE_EGL EGL_LIBRARY) -- Performing Test HAVE_GLESv2 -- Performing Test HAVE_GLESv2 - Failed -- Could NOT find GLESv2 (missing: GLESv2_INCLUDE_DIR GLESv2_LIBRARY HAVE_GLESv2 HAVE_GLESv2) -- Could NOT find Vulkan (missing: Vulkan_LIBRARY Vulkan_INCLUDE_DIR) -- Performing Test HAVE_evdev -- Performing Test HAVE_evdev - Failed -- Performing Test HAVE_integrityfb -- Performing Test HAVE_integrityfb - Failed -- Performing Test HAVE_linuxfb -- Performing Test HAVE_linuxfb - Failed -- Performing Test HAVE_directwrite -- Performing Test HAVE_directwrite - Success -- Performing Test HAVE_directwrite3 -- Performing Test HAVE_directwrite3 - Success -- Performing Test HAVE_d2d1 -- Performing Test HAVE_d2d1 - Success -- Performing Test HAVE_d2d1_1 -- Performing Test HAVE_d2d1_1 - Success -- Tool 'Qt6::moc' will be built from source. -- Tool 'Qt6::rcc' will be built from source. -- Tool 'Qt6::tracegen' will be built from source. -- Tool 'Qt6::cmake_automoc_parser' will be built from source. -- Looking for pthread.h -- Looking for pthread.h - not found -- Found Threads: TRUE -- Using Qt bundled PCRE2. -- 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:194 (qt_ensure_sync_qt) qtbase/src/corelib/CMakeLists.txt:29 (qt_internal_add_module) -- Configuring incomplete, errors occurred! See also "C:/Qt/6.1.2/build_x32/out/CMakeFiles/CMakeOutput.log". See also "C:/Qt/6.1.2/build_x32/out/CMakeFiles/CMakeError.log". CMake Error at C:/Qt/6.1.2/src/qtbase/cmake/QtProcessConfigureArgs.cmake:828 (message): CMake exited with code 1.
Any ideas what am I doing wrong and how to fix it? The mentioned log files didn't really help, I see no mentions of the error there at all.
-
Hi,
Where does that version of Perl come from ?
One possible way to get you through is to define HOST_PERL with the path to your Perl executable.
-
Hey and thank you for the quick response!
The perl version I have installed is a strawberry perl for windows. I tried your HOST_PERL suggestion but the message was exactly the same.
Is it possible the straberry perl to be unsupported for some reason? I tried getting ActiveState perl, but the whole download process there is complete and utter mistery - forking some projects, downloading something called state, which ... activates(??) .. something. I still can't figure out how the hell is one supposed to just get a perl installation. Or is it even possible.
-
AFAIR, you have the correct variant...
I just realized, if you want to build that version precisely, you could do it from the source archive directly which should be easier than from git.
-
After struggling for a while I found the problem. It turns out strawberry perl needs its own ~/c/bin directory to be in the PATH as well. It is fairly weird since this directory contains all kinds of stuff - gcc, g++, ar, iconv and a lot more so I really didn't want those to pollute my PATH. perl.exe itself seems to be working fine without it, but obviously there are some cases where it doesn't.
Using active perl (older version - 5.28, newer ones are not available for direct download it seems) is an option too, and it doesn't pollute the PATH with all that.
-
Glad you found out and thanks for sharing !
-
After struggling for a while I found the problem. It turns out strawberry perl needs its own ~/c/bin directory to be in the PATH as well. It is fairly weird since this directory contains all kinds of stuff - gcc, g++, ar, iconv and a lot more so I really didn't want those to pollute my PATH. perl.exe itself seems to be working fine without it, but obviously there are some cases where it doesn't.
Using active perl (older version - 5.28, newer ones are not available for direct download it seems) is an option too, and it doesn't pollute the PATH with all that.