I have a software in ubuntu that requires me to run qmake to generate the Makefile.
However, running qmake gives back this error,
qmake: could not find a Qt installation of ''
I have installed what I thought to be the required packages using,
sudo apt-get install qt4-qmake
sudo apt-get install qt5-qmake
But the error didn't go away.
Any help on this would be gladly appreciated!
sudo apt-get install qt5-default
works for me.
$ aptitude show qt5-default
tells that
This package sets Qt 5 to be the default Qt version to be used when using
development binaries like qmake. It provides a default configuration for
qtchooser, but does not prevent alternative Qt installations from being used.
You could check path to qmake using which qmake
.
Consider install qt4-default
or qt5-default
depends what version of qt you want use.
You could also use qtchooser - a wrapper used to select between Qt development binary versions.
For others in my situation, the solution was:
qmake -qt=qt5
This was on Ubuntu 14.04 after install qt5-qmake. qmake was a symlink to qtchooser which takes the -qt argument.
As Debian Qt's maintainer please allow me to suggest you to not use qtx-default. Please read qtchooser's man page, the solution is described there. If you are interested in packaging an app you can also take a look at this blog post I made explaining how to do it
I had this problem building jasmine-headless-webkit Ruby gem. Despite having qt4 installed, qmake
(a symlink to qtchooser
) insisted it didn't know about a QT installation. OTOH, it was able to list qt4 when asked directly.
This made everything better:
export QT_SELECT=qt4
qtchooser then knew to use qmake-qt4, and so on.
Search where is qmake-qt4:
which qmake-qt4
For example qmake-qt4 is in this path:
/usr/bin/qmake-qt4
Create symbolic link:
cd /usr/local/sbin/
ln -s /usr/bin/qmake-qt4 .
mv qmake-qt4 qmake
Regards
I have qt4 installed. I found that using the following path worked for me, despite 'which qmake' returning /usr/bin/qmake, which is just a link to qtchooser anyway.
The following path works for me, on a 64 bit system. Running from the full path of:
/usr/lib/x86_64-linux-gnu/qt4/bin/qmake
A symbolic link to the desired version, defined globally:
sudo ln -s /usr/bin/qmake-qt5 /usr/bin/qmake
... or per user:
sudo ln -s /usr/bin/qmake-qt5 /home/USERNAME/.local/bin/qmake
... to see if it works:
qmake --version