Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Getting qtchooser to recognize Qt version >=5.6 to use with qmake
kaybob last edited by kaybob
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.
sudo 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-gnu
The 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,
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 qt5
and 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).
export QTLIBDIR=$HOME/Qt/5.6/gcc_64so that
qtchooserwould know where to find the
qmakefor 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-gnu
I'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
However, after creating the file with the above contents in the same location at the other
.conffiles, it does now list
qt56as an option with
qtchooser -lbut when selecting
QT_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