CMake 和 VCPKG 无法通过 Qt6 编译我的代码

CMake and VCPKG won't compile my code via Qt6

提问人:NEON_GOD 提问时间:11/6/2023 更新时间:11/6/2023 访问量:35

问:

在Qt 12.0.0-beta2(11.08.83)中,当我尝试编译项目的CMake文本文件时,它给了我这个输出错误。

[cmake] Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S D:/deco-sewer -B D:/build-deco- 
sewer-Desktop_Qt_6_5_3_MSVC2019_64bit-Debug "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=D:\build-deco- 
sewer-Desktop_Qt_6_5_3_MSVC2019_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.5.3/msvc2019_64/bin/qmake.exe" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.5.3/msvc2019_64" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program 
Files (x86)/Microsoft Visual 
Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files (x86)/Microsoft Visual 
Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" in D:\build-deco-sewer Desktop_Qt_6_5_3_MSVC2019_64bit-Debug.
[cmake] -- Qt Creator: vcpkg package manager auto-setup. Skip this step by setting 
QT_CREATOR_SKIP_VCPKG_SETUP to ON.
[cmake] -- Running vcpkg install
[cmake] Detecting compiler hash for triplet x64-windows...
[cmake] The following packages will be built and installed:
[cmake]   * bzip2[core,tool]:x64-windows -> 1.0.8#5
[cmake]   * curl[core,non-http,schannel,ssl,sspi]:x64-windows -> 8.4.0
[cmake]   * giflib[core]:x64-windows -> 5.2.1#3
[cmake]   * leptonica[core]:x64-windows -> 1.83.1
[cmake]   * libarchive[bzip2,core,crypto,libxml2,lz4,lzma,zstd]:x64-windows -> 3.6.2
[cmake]   * libiconv[core]:x64-windows -> 1.17#1
[cmake]   * libjpeg-turbo[core]:x64-windows -> 3.0.1
[cmake]   * liblzma[core]:x64-windows -> 5.4.4
[cmake]   * libpng[core]:x64-windows -> 1.6.39#1
[cmake]   * libwebp[core,libwebpmux,nearlossless,simd,unicode]:x64-windows -> 1.3.2
[cmake]   * libxml2[core,iconv,lzma,zlib]:x64-windows -> 2.11.5#1
[cmake]   * lz4[core]:x64-windows -> 1.9.4#1
[cmake]     opencv3[core,default-features,dnn,flann,jpeg,png,quirc,tiff,webp]:x64-windows -> 3.4.18#11
[cmake]   * openjpeg[core]:x64-windows -> 2.5.0#1
[cmake]   * openssl[core]:x64-windows -> 3.1.3
[cmake]   * protobuf[core]:x64-windows -> 3.21.12
[cmake]   * quirc[core]:x64-windows -> 1.1#3
[cmake]     tesseract[core]:x64-windows -> 5.3.2
[cmake]   * tiff[core,jpeg,lzma,zip]:x64-windows -> 4.6.0#1
[cmake]   * vcpkg-cmake[core]:x64-windows -> 2023-05-04
[cmake]   * vcpkg-cmake-config[core]:x64-windows -> 2022-02-06#1
[cmake]   * vcpkg-cmake-get-vars[core]:x64-windows -> 2023-03-02
[cmake]   * vcpkg-get-python-packages[core]:x64-windows -> 2023-07-28
[cmake]   * zlib[core]:x64-windows -> 1.3
[cmake]   * zstd[core]:x64-windows -> 1.5.5#1
[cmake] Additional packages (*) will be modified to complete this operation.
[cmake] Restored 4 package(s) from C:\Users\danie\AppData\Local\vcpkg\archives in 184.6 ms. Use --debug to see more details.
[cmake] Installing 1/25 vcpkg-cmake-config:x64-windows...
[cmake] Elapsed time to handle vcpkg-cmake-config:x64-windows: 6.044 ms
[cmake] Installing 2/25 vcpkg-cmake:x64-windows...
[cmake] Elapsed time to handle vcpkg-cmake:x64-windows: 6.259 ms
[cmake] Installing 3/25 libwebp:x64-windows...
[cmake] Elapsed time to handle libwebp:x64-windows: 40.68 ms
[cmake] Installing 4/25 zlib:x64-windows...
[cmake] Elapsed time to handle zlib:x64-windows: 11.55 ms
[cmake] Installing 5/25 liblzma:x64-windows...
[cmake] Building liblzma[core]:x64-windows...
[cmake] -- Using cached tukaani-project-xz-v5.4.4.tar.gz.
[cmake] -- Cleaning sources at C:/vcpkg/buildtrees/liblzma/src/v5.4.4-6f848a7cca.clean. Use --editable to skip cleaning for the packages you specify.
[cmake] -- Extracting source C:/vcpkg/downloads/tukaani-project-xz-v5.4.4.tar.gz
[cmake] -- Applying patch fix_config_include.patch
[cmake] -- Applying patch win_output_name.patch
[cmake] -- Applying patch add_support_ios.patch
[cmake] -- Applying patch build-tools.patch
[cmake] -- Using source at C:/vcpkg/buildtrees/liblzma/src/v5.4.4-6f848a7cca.clean
[cmake] -- Found external ninja('1.11.0').
[cmake] -- Configuring x64-windows
[cmake] CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message):
[cmake]     Command failed: "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" -v
[cmake]     Working Directory: C:/vcpkg/buildtrees/liblzma/x64-windows-rel/vcpkg-parallel-configure
[cmake]     Error code: 1
[cmake]     See logs for more information:
[cmake]       C:\vcpkg\buildtrees\liblzma\config-x64-windows-dbg-CMakeCache.txt.log
[cmake]       C:\vcpkg\buildtrees\liblzma\config-x64-windows-rel-CMakeCache.txt.log
[cmake]       C:\vcpkg\buildtrees\liblzma\config-x64-windows-out.log
[cmake] 
[cmake] Call Stack (most recent call first):
[cmake]   D:/build-deco-sewer-Desktop_Qt_6_5_3_MSVC2019_64bit-Debug/vcpkg_installed/x64 windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:252 (vcpkg_execute_required_process)
[cmake]   ports/liblzma/portfile.cmake:23 (vcpkg_cmake_configure)
[cmake]   scripts/ports.cmake:168 (include)
[cmake] 
[cmake] 
[cmake] error: building liblzma:x64-windows failed with: BUILD_FAILED
[cmake] error: Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
[cmake] Then check for known issues at:
[cmake]     https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+liblzma
[cmake] You can submit a new issue at:
[cmake]     https://github.com/microsoft/vcpkg/issues/new?template=report-package-build failure.md&title=[liblzma]+Build+error
[cmake] Include '[liblzma] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
[cmake]     vcpkg-tool version: 2022-11-10-5fdee72bc1fceca198fb1ab7589837206a8b81ba
[cmake]     vcpkg-scripts version: 6f7ffeb18 2022-11-11 (12 months ago)
[cmake] 
[cmake] 
[cmake] Please use the prefilled template from D:\build-deco-sewer-Desktop_Qt_6_5_3_MSVC2019_64bit-Debug\vcpkg_installed\vcpkg\issue_body.md when reporting your issue.
[cmake] -- Running vcpkg install - failed
[cmake] CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:899 (message):
[cmake]   vcpkg install failed.  See logs for more information:
[cmake]   D:\build-deco-sewer-Desktop_Qt_6_5_3_MSVC2019_64bit-Debug\vcpkg-manifest-install.log
[cmake] Call Stack (most recent call first):
[cmake]   D:/build-deco-sewer-Desktop_Qt_6_5_3_MSVC2019_64bit-Debug/vcpkg-dependencies/toolchain.cmake:6 (include)
[cmake]   C:/Qt/Tools/CMake_64/share/cmake-3.24/Modules/CMakeDetermineSystem.cmake:124 (include)
[cmake]   CMakeLists.txt:3 (project)
[cmake] 
[cmake] 
[cmake] CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
[cmake] -- Configuring incomplete, errors occurred!
[cmake] 
[cmake] CMake process exited with exit code 1.
[cmake] 
[cmake] Elapsed time: 00:08.

然而,liblzma:x64-windows 安装在 vcpkg 目录中,它让我将其安装在那里,但是当我尝试将其安装在其他地方时,它不会让我,对文件的权限都被授予了,所以这应该不是一个令人担忧的事情。我尝试了较新版本的 VS (2022) 和旧版本的 Qt,但此错误仍然相同,我重新安装了 vcpkg 和 cmake,但问题仍然存在。

QT6型

评论


答: 暂无答案