6

qmake: could not find a Qt installation of ''

This thread was not of any help to me. qmake: could not find a Qt installation of ''.

How can I get qmake to recognize where the Qt folder is?

Right now it is installed in /opt/Qt5.1.0.

Community
  • 1
  • 1
ShrimpCrackers
  • 4,388
  • 17
  • 50
  • 76

4 Answers4

12

Have you installed the qt5-default ? You need to do this in addition to running the Qt supplier .run file.

sudo apt-get install qt5-default
WaffleSouffle
  • 3,293
  • 2
  • 28
  • 27
  • 3
    qt5-default brings 131 other packages with it. I want to use qmake on a remote server where I don't need any x11 packages at all. How could I avoid all this x11-bull-shit installation but get qmake working well? – arilou Jul 11 '16 at 09:03
4

This message shown by qtchooser app. To setup it properly, you should make conf files in /etc/xdg/qtchooser/

for example:

$ ls -1 /etc/xdg/qtchooser/
default.conf
qt-4.8.5.conf
qt-5.1.0.conf

each file has two lines: path to bin, path to lib:

$ cat /etc/xdg/qtchooser/default.conf 
/opt/Qt/4.8.5/bin
/opt/Qt/4.8.5/lib

additional info: man qtchooser

dima_weber
  • 91
  • 2
2

The solution for me on this problem was to specify the QT version, as this message was being generated by /usr/bin/qtchooser

So in my case, it was QT4 I was trying to use, and running:

qmake

generated the error (could not find a Qt installation of '')

qmake -qt=qt4

fixed that error though. In my case, it was a Ruby Gem trying to compile with qmake, so I couldn't get it to pass in that extra command line argument, so I instead added this to my profile

export QT_SELECT=qt4

And now QT4 runs just fine on my Ubuntu system.

Phantomwhale
  • 1,789
  • 1
  • 16
  • 30
1

For me the symlink to default.conf was missing in /usr/share/qtchooser. It wasn't enough to put it into /etc/xdg/qtchooser.

Martin Gerhardy
  • 1,860
  • 22
  • 13