Unsolved Problems with qmake Debian 9 ( qmake: could not exec ....)
-
Hi ,
I just start Qt on Debian and i have a problem when i use qmake :qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
I see on another message that i need to change PATH on /home/session/.profile . I did it and i have another error
qmake: could not find a Qt installation of '/home/lenawel/Qt'
Can you help me to try to fix it please
Thx a lot -
@Lenawel What Qt are you using? The one packaged by Debian or did you install one using online/offline installer?
No need to change PATH! Just use absolute path to qmake when calling it. -
@jsulm is right, there's no need to change the path.
qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
That's one of the Debian (or Ubuntu, etc) installations, but obviously its missing... a little more on that in a minute.
If you've installed Qt using the online / offline installer, then just run QMake using a full path as @jsulm suggested, eg:
~/opt/qt/5.10.1/gcc_64/bin/qmake
Now back to the official Debian packages. Basically, Debian (and derivatives such as Ubuntu) use a "qtchooser" application such that when you run
qmake
, you're actually running theqtchooser
front-end. eg:paul@paul-XPS-13-9343:~$ which qmake /usr/bin/qmake paul@paul-XPS-13-9343:~$ ls -l /usr/bin/qmake lrwxrwxrwx 1 root root 9 Dec 22 08:00 /usr/bin/qmake -> qtchooser paul@paul-XPS-13-9343:~$
Based on the error message, it looks like your "qtchooser" is defaulting to Qt4, but you probably don't have Qt4 installed, and you probably want to be using Qt5 instead.
So, to see what (Debian-packaged) versions of Qt you have available
qtchooser -l
Then, you can choose the version by adding
-qt<version>
, eg:paul@paul-XPS-13-9343:~$ qmake -qt4 -v QMake version 2.01a Using Qt version 4.8.7 in /usr/lib/x86_64-linux-gnu paul@paul-XPS-13-9343:~$ qmake -qt5 -v QMake version 3.1 Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu paul@paul-XPS-13-9343:~$
Again, note this is not actually QMake that is processing the
-qt4
and-qt5
, but theqtchooser
front-end.You can set the default version a few ways (see the man pages for
qtchooser
), or you just use the full path (eg/usr/lib/qt5/bin/qmake
).Cheers.
PS Make you have the
qt5-qmake
package installed (assuming you want Qt5). -
Is debian 9 (I believe stretch) the current stable? I use testing so I don't follow the releases closely.
@Lenawel said in Problems with qmake Debian 9 ( qmake: could not exec ....):
qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
You don't have that qmake (for qt4).
I see on another message that i need to change PATH on /home/session/.profile
Nope, this is wrong.
Just installqt5-qmake
andqt5-default
to get the release's qt5 qmake installed and set as default. Additionally if you're developing with Qt you'll needlibqt5XXX
, whereXXX
is the module name andlibqt5XXX-dev
for the development package (headers and debug information). Browse the official repo for more packages you might be interested in (each Qt module is packaged separately on debian). -
Thx for your answer i will try it .
I use online installer and my version is Qt 5.10.1 in debian 9 64 bits -
Hi,
In that case, you have to use the full path to the
qmake
executable you want to use.That's a good habit to take so you are sure of which version of Qt you are using .