qmake: could not find a Qt installation of ''
Solution 1
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.
Solution 2
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.
Solution 3
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.
Solution 4
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
# method 1
QT_SELECT=qt5 qmake
# method 2:
export QT_SELECT=qt5
qmake
... more qt commands here
# method 3:
make -qt5
To use Qt 4, just replace the qt5
with qt4
Update 20210202: starting from Debian 11 (bullseye) the packages qtx-default do not longer exist. Same goes for Ubuntu, but I don't know in which specific version. If you know of a package that still has the dependency (mostly non-Debian official packages) please file a bug. Same goes for Wiki pages, etc.
Solution 5
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.
Related videos on Youtube
![IssamLaradji](https://i.stack.imgur.com/8ILOh.jpg?s=256&g=1)
IssamLaradji
Updated on December 26, 2021Comments
-
IssamLaradji over 2 years
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!
-
sashoalm about 11 yearsTry running
sudo apt-get install qtcreator
. It installs the full Qt SDK + an IDE. It should add everything you need. -
IssamLaradji about 11 yearsHi @sashoalm, thanks a lot, seems I had other packages missing. Now its working :D
-
Scone about 9 yearsThis is not a good solution as it will install many potentially unneeded packages.
-
-
IssamLaradji about 11 yearsHi @Warthel4578, thanks, your answer helped me indirectly, since I installed qt4-qmake, I should have invoked 'qt4-qmake' instead of 'qmake' (I found both of them in the directory path). Now its working :)
-
user35443 almost 11 yearsCan you please decribe your solution more?
-
thias over 9 yearsthe accepted answer is not an answer at all. This one should be the accepted answer.
-
Scone about 9 yearsThanks Warthel this helped me discover why my qmake wasn't working. qmake on Ubuntu 14.04 was symlinked to qtchooser
-
Alex Ryan almost 9 yearsPerfect! I had the same problem when trying to install qBittorrent, and mine was solved with
export QT_QMAKE=/usr/bin
. Never know when those environment variables will come back to bite ya! -
Robie Basak almost 9 yearsCan you explain why we shouldn't use qtx-default, please? The qtchooser manpage helps me understand what is going on, but I don't see why having a package supply a default is a problem.
-
Salil over 8 yearsFollowing sets up the complete qt5 development installation for me: apt-get install qt5base-dev qtdeclarative5-dev qt5-qmake qt5-default qttools5-dev-tools And then check using: qtchooser -print-env
-
Xofo almost 8 yearsIt would be nice if qmake-qtX was bundled under the relevant qt version. Pulling in these pieces is bit cumbersome.
-
Martin Zeitler over 7 yearshow about to add a comment, why this answer was down-voted? failing to understand or to apply the solution does not exactly qualify as a valid reason ...while I'm pretty certain it works, because I have it working just like that.
-
sameers almost 7 yearsI got to this SO answer, then found, based on the next error (
no qtwebkit installation found
) that I also had to runapt-get install qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x
as described on the Thoughtbot Github wiki page -
lisandro over 6 years@RobieBasak sure thing: let's say you install qt5-default. Then you run a qt4 application which calls qdbus. You get qt5's qdbus, which should work but it's not warranted to do it.
-
Robie Basak over 6 yearsSurely that's a bug in how the qt4 application calls qdbus or in the environment the qt4 application was run in, rather than my choice to want qt5 by default from my CLI?
-
lisandro over 6 yearsFirst thing: maybe qdbus was a bad example. Let's say upstream decided to not rename Qt's underlying tools with the 4 to 5 change. So it is not possible to know beforehand which version the app will run except you have qtchooser in the middle. But qtchooser, even if it's a nice attempt, does fall short in a number of places, at least in the distro world. Ideally each app should be either be recalled after the major version or compatibility should be retained.
-
Tom Saleeba over 5 yearsThis is a great solution when you just want
qmake
and don't want a full qt environment. -
While-E over 5 yearsThrowing the upvote your way because I'm not an apt-get tard, and I actually build from source, and this symlink answer was the closes to getting me on track because I forgot I had aliased my 'qmake'. Thanks.
-
Akito over 4 yearsOf all the answers this is actually the only one that remotely worked. Except I needed to use
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake
.