我已经安装了 qt5.5电力供应协议. 但我得到了以下输出。
ansh@ansh-HP:~$ qmake -query
qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
ansh@ansh-HP:~$ ls /usr/lib/x86_64-linux-gnu/qt4/bin/
qdbus
ansh@ansh-HP:~$ qml
qml: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qml': No such file or directory
ansh@ansh-HP:~$ which qmake
/usr/bin/qmake
ansh@ansh-HP:~$ ll /usr/bin/qmake
lrwxrwxrwx 1 root root 9 Mar 9 2015 /usr/bin/qmake -> qtchooser*
执行/opt/qt55/bin/qt55-env.sh
并没有为我设置环境变量。
ansh@ansh-HP:~$ /opt/qt55/bin/qt55-env.sh
ansh@ansh-HP:~$ cat /opt/qt55/bin/qt55-env.sh
#!/bin/bash
QT_BASE_DIR=/opt/qt55
export QTDIR=$QT_BASE_DIR
export PATH=$QT_BASE_DIR/bin:$PATH
if [[ $(uname -m) == "x86_64" ]]; then
export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRARY_PATH
else
export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/i386-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRARY_PATH
fi
export PKG_CONFIG_PATH=$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
TEST=`echo $0 | grep wrapper`
if [ "$TEST" != "" ]; then
exec `echo $0 | sed s/-wrapper//` $*
fi
ansh@ansh-HP:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
答案1
正如 PPA 描述中所述:
适用于 Trusty Ubuntu 版本的 i386 和 amd64 软件包。
每个包包含一个 Qt 模块并安装在 /opt/qt55 前缀下。
源 /opt/qt55/bin/qt55-env.sh 来设置正确的环境。
所以
source /opt/qt55/bin/qt55-env.sh