Getting qtchooser to recognize Qt version >=5.6 to use with qmake
-
Background: I'm an engineer but a novice Linux user on Ubuntu 16.04. I'm trying to use some code from a github repository that states it requires Qt >=5.6 to compile.
Usingsudo apt-get install qt5-qmakeonly installs Qt version 5.5, i.e.:~$ qmake -v QMake version 3.0 Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnuThe only way I found to install Qt >=5.6 was to use the open source installer at https://www.qt.io/download. Using that, I installed Qt 5.6 (as well as 5.11) to the default location,
home/username/Qt.However,
qtchooserapparently doesn't recognize any of the versions installed via the qt.io installer, i.e.:~$ qtchooser -l 4 5 default qt4-x86_64-linux-gnu qt4 qt5-x86_64-linux-gnu qt5and if I change the version (via
QT_SELECT=qt5or such), it only points to the version installed with apt-get (Qt version 5.5.1).I tried
export QTLIBDIR=$HOME/Qt/5.6/gcc_64so thatqtchooserwould know where to find theqmakefor 5.6, but it seems to just ignore it, i.e. I still get~$ qmake --version QMake version 3.0 Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnuI've found older answers elsewhere that state to add a
qt56.confor similar file to/usr/lib/x86_64-linux-gnu/qtchooserwith the right folders, which I assumed was$HOME/Qt/5.6/gcc_64/bin $HOME/Qt/5.6/gcc_64However, after creating the file with the above contents in the same location at the other
.conffiles, it does now listqt56as an option withqtchooser -lbut when selectingQT_SELECT=qt56, it simpy reverts to the default (`QT_SELECT="default").Summary question: How do I enable
qtchooserto recognize the versions of Qt installed with the qt.io installer? -
Do you really need qtchooser? If you installed Qt from official installer, you can:
- open your project in Qt Creator and easily compile/ develop from there
- from command line, just use
export PATH=/path/to/your/qt/installation/qtversion/gcc_64/bin:$PATHand then correct qmake will be used. Then compiling your app is simple:qmake && make