在Ubuntu 22.04中安装Qt6后使用
sudo apt install qt6-base-dev
调用qmake
会产生错误消息:
qmake: could not find a Qt installation of ''
但是,可以调用/运行qmake6
。如何使qmake
工作并指向qmake6
?
发布于 2023-03-21 10:34:48
在Ubuntu22.04中,目前有一个开放的bug QtChooser不支持qt6。
因此,即使Qt6是使用sudo apt install qt6-base-dev
安装的,qtchooser -l
也不列出qt6选项,qmake
输出qmake: could not find a Qt installation of ''
。
假设安装了Qt6并调用了qmake6
,我相信有两个选项:
1.选择Qt6系统范围内的
基于到qt6.conf
的路径生成qmake6
qtchooser -install qt6 $(which qmake6)
将qt6.conf
移动到系统范围的dir。
sudo mv ~/.config/qtchooser/qt6.conf /usr/share/qtchooser/qt6.conf
将Qt6设置为默认选项
sudo mkdir -p /usr/lib/$(uname -p)-linux-gnu/qt-default/qtchooser
sudo ln -n /usr/share/qtchooser/qt6.conf /usr/lib/$(uname -p)-linux-gnu/qt-default/qtchooser/default.conf
2.只为当前用户选择Qt6
基于到qt6.conf
的路径生成qmake6
qtchooser -install qt6 $(which qmake6)
选择Qt6作为默认值(放置在~/.bashrc
中用于持久性):
export QT_SELECT=qt6
https://askubuntu.com/questions/1460242
复制相似问题