linux修改qmake路径,如何更改用于qmake的Qt版本?
qmake(/usr/bin/qmake)实际上只是qtchooser(/usr/bin/qtchooser)的符号链接。这是来自的报价man qtchooser:FILES/etc/xdg/qtchooser/default.confSystem-wideconfigurationfiles. Each has two lines, the firstis the path to the...
qmake(/usr/bin/qmake)实际上只是qtchooser(/usr/bin/qtchooser)的符号链接。
这是来自的报价man qtchooser:
FILES
/etc/xdg/qtchooser/default.conf
System-wide configuration files. Each has two lines, the first
is the path to the binaries and the second is the path to the Qt
libraries. If a default.conf is provided, the settings from it
will be automatically used in case nothing else is selected.
$HOME/.config/qtchooser/*.conf
User configuration files.
该文件的/etc/xdg/qtchooser/default.conf优先级高于/usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf。以下是在qmake系统示例中选择默认Qt版本的步骤(Ubuntu 17.10 x64,Qt 5.10.1)。
创建/etc/xdg/qtchooser目录:
sudo mkdir /etc/xdg/qtchooser
创建和编辑配置文件:
gksudo gedit /etc/xdg/qtchooser/default.conf
如上所述。该文件必须包含两行:第一行是Qt二进制文件(包括qmake)的路径,第二行是Qt库(包括.so文件)的路径。以我为例:
/5.10.1/gcc_64/bin
/5.10.1/gcc_64/lib
保存并关闭。现在qmake应该使用指定的Qt版本。
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐

所有评论(0)