You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Linux环境构建Windows版Prism Launcher遇配置及权限错误

在Linux上构建Windows版Prism Launcher的CMake错误排查

初始错误:找不到KDEInstallDirs模块

错误日志

amiroof@amiroofPC:~/Games/PrismLauncher-Cracked$ cmake -Bbuild -DCMAKE_INSTALL_PREFIX=install -DENABLE_LTO=ON -DLauncher_QT_VERSION_MAJOR=6 -DCMAKE_PREFIX_PATH=/home/amiroof/Qt/6.4.0/msvc2019_64/lib/cmake
-- IPO / LTO will only be enabled for release builds
-- Using bundled ECM
-- Git commit: 6b2346a363ecbd1fab59cdd717a59e0661454796
-- Git tag: -128-NOTFOUND
-- Git refspec: refs/heads/develop
-- Checking for one of the modules 'scdoc'
CMake Error at CMakeLists.txt:311 (include):
  include could not find requested file:

    KDEInstallDirs


CMake Error at CMakeLists.txt:323 (install):
  install FILES given no DESTINATION!


CMake Error at CMakeLists.txt:324 (install):
  install FILES given no DESTINATION!


CMake Error at CMakeLists.txt:326 (install):
  install FILES given no DESTINATION!


-- Using system zlib
-- Using bundled QuaZip
-- Using Qt version 6
-- Using bundled tomlplusplus
-- Using bundled ghc_filesystem
-- System name: Linux
-- Compiler ID: GNU
-- CMAKE_CXX_COMPILE_FEATURES: cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23
-- Configuring incomplete, errors occurred!
See also "/home/amiroof/Games/PrismLauncher-Cracked/build/CMakeFiles/CMakeOutput.log".

解决方法

安装extra-cmake-modules包,不同发行版对应命令:

  • Debian/Ubuntu系:sudo apt install extra-cmake-modules
  • Fedora/RHEL系:sudo dnf install extra-cmake-modules
  • Arch系:sudo pacman -S extra-cmake-modules

后续错误:Qt6 qtpaths权限被拒绝

错误日志

amiroof@amiroofPC:~/Games/PrismLauncher-Cracked$ sudo cmake -Bbuild -DCMAKE_INSTALL_PREFIX=install -DENABLE_LTO=ON -DLauncher_QT_VERSION_MAJOR=6 -DCMAKE_PREFIX_PATH=/home/amiroof/Qt/6.4.0/msvc2019_64/lib/cmake
-- IPO / LTO will only be enabled for release builds
-- Git commit: 6b2346a363ecbd1fab59cdd717a59e0661454796
-- Git tag: -128-NOTFOUND
-- Git refspec: refs/heads/develop
-- Checking for one of the modules 'scdoc'
CMake Warning at /usr/share/ECM/modules/ECMQueryQt.cmake:97 (message):
  Failed call: "QT_INSTALL_PREFIX"
Call Stack (most recent call first):
  /usr/share/ECM/kde-modules/KDEInstallDirs6.cmake:201 (ecm_query_qt)
  /usr/share/ECM/kde-modules/KDEInstallDirs.cmake:15 (include)
  CMakeLists.txt:311 (include)


CMake Error at /usr/share/ECM/modules/ECMQueryQt.cmake:98 (message):
  Qt6 qtpaths call failed: Permission denied
Call Stack (most recent call first):
  /usr/share/ECM/kde-modules/KDEInstallDirs6.cmake:201 (ecm_query_qt)
  /usr/share/ECM/kde-modules/KDEInstallDirs.cmake:15 (include)
  CMakeLists.txt:311 (include)


-- Configuring incomplete, errors occurred!
See also "/home/amiroof/Games/PrismLauncher-Cracked/build/CMakeFiles/CMakeOutput.log".

解决方法

  1. 避免用sudo运行cmake:你的Qt安装在用户目录/home/amiroof/Qt/下,root用户无权限访问该目录,直接以普通用户身份重新执行命令:
    cmake -Bbuild -DCMAKE_INSTALL_PREFIX=install -DENABLE_LTO=ON -DLauncher_QT_VERSION_MAJOR=6 -DCMAKE_PREFIX_PATH=/home/amiroof/Qt/6.4.0/msvc2019_64/lib/cmake
    
  2. 修复Qt目录权限:确保普通用户对Qt安装目录有读写权限,执行:
    chmod -R u+rwx /home/amiroof/Qt/6.4.0/msvc2019_64/
    
  3. 纠正Qt版本选择:你当前指定的是MSVC版本的Qt,这是Windows平台的编译器版本,在Linux上交叉编译Windows程序需要使用MinGW版本的Qt。需下载对应架构的MinGW Qt包,再修改CMAKE_PREFIX_PATH指向正确的MinGW Qt的cmake目录。

内容的提问来源于stack exchange,提问作者amirmohammad firouzfar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.26 11:07:00