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

CMake查找Qt6Quick组件失败,需安装哪些额外依赖包?

Qt6 Quick组件缺失的依赖安装解决方案

当前系统已安装qt6-base-dev、qt6-base-dev-tools、qt6-qmltooling-plugins包,执行以下CMake代码可正常运行:

find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)

但添加Quick组件后,执行如下代码会报错:

find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Quick)

报错信息:

-- Could NOT find Qt6Quick (missing: Qt6Quick_DIR)
CMake Error at CMakeLists.txt:10 (find_package):
Found package configuration file:

/usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake

but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
FOUND. Reason given by package:

Failed to find Qt component "Quick".

Expected Config file at
"/usr/lib/x86_64-linux-gnu/cmake/Qt6Quick/Qt6QuickConfig.cmake" does NOT
exist

需要安装的依赖包

  • 针对Debian/Ubuntu系列发行版,需安装qt6-declarative-dev包,该包包含Qt6 Quick模块的所有开发必需文件,其中就包括缺失的Qt6QuickConfig.cmake配置文件。

安装命令:

sudo apt install qt6-declarative-dev

说明:Qt6的Quick模块隶属于Qt Declarative模块,因此对应的开发包采用qt6-declarative-dev的命名,而非单独的qt6-quick-dev。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.03 00:33:21