問題是,在我嘗試從原始碼建立超級對撞機之前,請確保我使用的是 Qt5。問題是這樣的:
jsimon@edgy:~$ qmake -v
qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
jsimon@edgy:~$ locate qmake
/usr/bin/qmake
我認為 qtchooser 是否配置錯誤,這裡的文檔:
和這裡:
進一步挖掘,有一個目錄,其中包含一些符號連結:
jsimon@edgy:/usr/lib/x86_64-linux-gnu/qtchooser$ ls -al
lrwxrwxrwx 1 root root 50 Sep 1 06:04 4.conf -> ../../../share/qtchooser/qt4-x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 50 Sep 1 06:04 5.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 50 Sep 1 06:04 qt4.conf -> ../../../share/qtchooser/qt4-x86_64-linux-gnu.conf
lrwxrwxrwx 1 root root 50 Sep 1 06:04 qt5.conf -> ../../../share/qtchooser/qt5-x86_64-linux-gnu.conf
另一個更深的目錄在我看來是問題所在,一個將 Qt4 作為預設值的符號連結:
jsimon@edgy:/usr/lib/x86_64-linux-gnu/qt-default/qtchooser$ ls -al
lrwxrwxrwx 1 root root 53 Sep 1 06:04 default.conf -> ../../../../share/qtchooser/qt4-x86_64-linux-gnu.conf
來自 qtchooser 的一些資訊:
jsimon@edgy:~$ qtchooser -print-env
QT_SELECT="default"
QTTOOLDIR="/usr/lib/x86_64-linux-gnu/qt4/bin"
QTLIBDIR="/usr/lib/x86_64-linux-gnu"
看看這個頁面,應該很簡單:
然而:
jsimon@edgy:~$ export QT_SELECT=qt5
jsimon@edgy:~$ printenv
[snip]
QT_SELECT=qt5
[snip]
jsimon@edgy:~$ qmake -v
qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt5/bin/qmake': No such file or directory
回到我們開始的地方,沒有改變。怎麼辦?
答案1
所有這一切都被證明是一個轉移注意力的事情:所需要的只是安裝 qmake,例如:
sudo apt install qt5-qmake