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นี่คือขั้นตอนของการเลือกรุ่น Qt เริ่มต้นสำหรับqmakeตัวอย่างของระบบของฉัน (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) ในกรณีของฉันมันจะเป็น:
<Qt_dir>/5.10.1/gcc_64/bin
<Qt_dir>/5.10.1/gcc_64/lib
บันทึกและปิด ตอนนี้qmakeควรใช้รุ่น Qt ที่ระบุ