在 Ubuntu 中安装新版本的 QtCreator 后
tux-world@alachiq:~ > sudo apt-get install qt5-qmake build-essential g++ gcc
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
g++ is already the newest version.
g++ set to manually installed.
gcc is already the newest version.
qt5-qmake is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 247 not upgraded.
在选项中Build & Run
并选择 qmake/usr/bin/qmake
我收到此错误:
The qmake executable /usr/lib/i386-linux-gnu/qt4/bin/qmake could not be added: qmake '/usr/lib/i386-linux-gnu/qt4/bin/qmake' is not an executable.
在家庭系统中,安装这些软件包并在选项中设置 Qmake 后,我没有任何问题
其他信息:
tux-world@alachiq:~ > apt-cache search qt5-qmake
qt5-qmake - Qt 5 qmake Makefile generator tool
tux-world@alachiq:~ > ldd /opt/qtForArm/bin/qmake
ldd: /opt/qtForArm/bin/qmake: No such file or directory
tux-world@alachiq:~ > sudo chmod +x /usr/lib/i386-linux-gnu/qt4/bin/qmake
[sudo] password for tux-world:
chmod: cannot access ‘/usr/lib/i386-linux-gnu/qt4/bin/qmake’: No such file or directory
更新:
tux-world@alachiq:~ > apt-cache policy qt5-qmake
qt5-qmake:
Installed: 5.2.1+dfsg-1ubuntu14.2
Candidate: 5.2.1+dfsg-1ubuntu14.2
Version table:
*** 5.2.1+dfsg-1ubuntu14.2 0
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main i386 Packages
100 /var/lib/dpkg/status
5.2.1+dfsg-1ubuntu14 0
500 http://archive.ubuntu.com/ubuntu/ trusty/main i386 Packages
tux-world@alachiq:~ > ls -a -l /usr/bin/qmake
lrwxrwxrwx 1 root root 9 فوریه 19 15:53 /usr/bin/qmake -> qtchooser
tux-world@alachiq:~ > qtchooser
Usage:
qtchooser { -l | -list-versions | -print-env }
qtchooser -run-tool=<tool name> [-qt=<Qt version>] [program arguments]
<executable name> [-qt=<Qt version>] [program arguments]
Environment variables accepted:
QTCHOOSER_RUNTOOL name of the tool to be run (same as the -run-tool argument)
QT_SELECT version of Qt to be run (same as the -qt argument)
tux-world@alachiq:~ >
答案1
您已经安装了 qt5-qmake,但您的 Qt Creator 正在寻找 Qt4 版本的 qmake。您可以安装 qt4-qmake 或将 Qt5 qmake 可执行文件添加到 Qt Creator(工具 -> 选项 -> 构建和运行 -> Qt 版本)。
/在问题更新后编辑:
Qt Chooser 是一个根据其配置和/或环境变量自动选择正确的 Qt 二进制文件的工具。
如果您想使用 Qt 5 qmake,您只需安装该软件包即可qt5-default
。这会将/usr/bin/qmake
Qt Chooser 提供的各种二进制文件(如 )指向您的 Qt 5 安装。如果您想使用 Qt 4 qmake,则需要安装qt4-default
,它的作用相同,但适用于 Qt 4。