我想在我的台式机上构建一个 Qt5 示例。我安装了qt5-default
和qtdeclarative5-dev
,但仍然收到此错误:
Project ERROR: Unknown module(s) in QT: quick qml
编译时需要安装哪个包?在 Qt4 时代,它很简单libqt4-dev
答案1
Qt 模块 dev 包 lib 包 ------------------------------------------------------------------------- 蓝牙 qtconnectivity5-dev libqt5bluetooth5 并发 qtbase5-dev libqt5concurrent5 连接性 qtmobility-dev libqtconnectivity1 联系人 qtmobility-dev libqt5contacts5 核心 qtbase5-dev libqt5core5a dbus qtbase5-dev libqt5dbus5 设计师 qttools5-dev libqt5designer5 designercomponents qttools5-dev libqt5designercomponents5 反馈 qtmobility-dev libqt5feedback5 画廊 qtmobility-dev libqtgallery1 gui qtbase5-dev libqt5gui5 帮助 qttools5-dev libqt5help5 位置 qtmobility-dev libqt5location5 多媒体 qtmultimedia5-dev libqt5multimedia5 多媒体套件 qtmobility-dev libqtmultimediakit1 网络 qtbase5-dev libqt5network5 networkauth libqt5networkauth5-dev libqt5networkauth5 NFC qtconnectivity5-dev libqt5nfc5 opengl libqt5opengl5-dev libqt5opengl5 组织者 qtmobility-dev libqt5organizer5 定位 qtpositioning5-dev libqt5positioning5 打印支持 qtbase5-dev libqt5printsupport5 发布订阅 qtmobility-dev libqt5publishsubscribe5 qml qtdeclarative5-dev libqt5qml5 快速 qtdeclarative5-dev libqt5quick5 quickparticles qtdeclarative5-dev libqt5quickparticles5 quicktest qtdeclarative5-dev libqt5quicktest5 quickwidgets qtdeclarative5-dev libqt5quickwidgets5 脚本 qtscript5-dev libqt5script5 脚本工具 qtscript5-dev libqt5scripttools5 传感器 qtmobility-dev、libqt5sensors5-dev libqt5sensors5 串行端口 libqt5serialport5-dev libqt5serialport5 服务框架 qtmobility-dev libqt5serviceframework5 sql qtbase5-dev libqt5sql5 svg libqt5svg5-dev libqt5svg5 系统信息 qtmobility-dev libqt5systeminfo5 测试 qtbase5-dev libqt5test5 uitools qttools5-dev? versit qtmobility-dev libqtversit1 网络频道?? webkit libqt5webkit5-dev libqt5webkit5 websockets libqt5websockets5-dev libqt5websockets5 小部件 qtbase5-dev libqt5widgets5 x11extras libqt5x11extras5-dev libqt5x11extras5 xml qtbase5-dev libqt5xml5 xmlpatterns libqt5xmlpatterns5-dev libqt5xmlpatterns5
答案2
您需要安装
qtdeclarative5-dev
答案3
标题的答案是:
sudo apt-get install qtbase5-dev
不过,对于您的具体问题,上述答案是正确的。
答案4
sudo apt-get install qtdeclarative5-dev qml-module-qtquick-controls
通过以下方式验证安装:
qtchooser -print-env
输出可能类似于以下内容(基于您的 Ubuntu 版本可用的软件包):
QT_SELECT="default"
QTTOOLDIR="/usr/lib/x86_64-linux-gnu/qt5/bin"
QTLIBDIR="/usr/lib/x86_64-linux-gnu"
参考这里。