arduinian
Posts: 3
Joined: Wed Jan 06, 2016 9:09 am

qmake: could not exec '/usr/lib/arm-linux-gnueabihf/qt4/bin/

Wed Jan 06, 2016 9:24 am

Hi,

I installed a fresh Raspbian Jessie 2015-11-21 and 2 Qt related tools — qtcreator and qt5-qmake:

Code: Select all

> sudo apt-get update
> sudo apt-get install qtcreator
> sudo apt-get install qt5-qmake
I managed to open up QtCreator using:

Code: Select all

> sudo qtcreator -noload Welcome
When I tried to compile, it complained that: qmake: could not exec '/usr/lib/arm-linux-gnueabihf/qt4/bin/qmake': No such file or directory

Inside /usr/lib/arm-linux-gnueabihf folder I can see both qt4 and qt5 folder. But the qt4/bin has only qdbus. The qt5/bin has qmake in it but if run it directly, it return the same error: qmake: could not exec '/usr/lib/arm-linux-gnueabihf/qt4/bin/qmake': No such file or directory

Any idea?

User avatar
topguy
Posts: 7147
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: qmake: could not exec '/usr/lib/arm-linux-gnueabihf/qt4/

Wed Jan 06, 2016 10:46 am

The system supports that you have several versions of Qt installed, and all executables are registered and chosen with an app called qtchooser.
- Man page: http://manpages.ubuntu.com/manpages/uto ... ser.1.html
- Better info: https://harishnavnit.wordpress.com/2014 ... ons-of-qt/

The errors tells me that the system still thinks you want to use Qt4.
So adding "export QT_SELECT = 5" to your "~/.profile" or "~/.bashrc" should make sure that you always get Qt5 selected.

arduinian
Posts: 3
Joined: Wed Jan 06, 2016 9:09 am

Re: qmake: could not exec '/usr/lib/arm-linux-gnueabihf/qt4/

Thu Jan 07, 2016 1:40 am

Thanks for info, topguy!

I did what's laid out in the second link you posted and I can see a few versions of Qt in the system:

Code: Select all

pi@raspberrypi:~/TestConsole $ qtchooser -list-versions
4
5
default
qt4-arm-linux-gnueabihf
qt4
qt5-arm-linux-gnueabihf
qt5
Then I added export QT_SELECT=5 to my ~/.bashrc file:

Once I did that, I am able to run following:

Code: Select all

pi@raspberrypi:~/TestConsole $ qmake -v
QMake version 3.0
Using Qt version 5.3.2 in /usr/lib/arm-linux-gnueabihf
But if tried to generate a makefile like below, it complained the same thing. It seemed like the linking system is somehow broken, it kept trying to use qt4 which doesn't have qmake under its folder.

Code: Select all

pi@raspberrypi:~/TestConsole $ sudo qmake TestConsole.pro
qmake: could not exec '/usr/lib/arm-linux-gnueabihf/qt4/bin/qmake': No such file or directory
So I thought maybe I can just put in the full path when I use qmake and when I did, I am able to generate a makefile

Code: Select all

pi@raspberrypi:~/TestConsole $ sudo /usr/lib/arm-linux-gnueabihf/qt5/bin/qmake TestConsole.pro
Following issue showed up and I suppose the make system coulnd't find the Qt framework/library. Do I need to install any other dependency for this to work?

Code: Select all

pi@raspberrypi:~/TestConsole $ sudo make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++ -I. -isystem /usr/include/arm-linux-gnueabihf/qt5 -isystem /usr/include/arm-linux-gnueabihf/qt5/QtCore -I. -o main.o main.cpp
main.cpp:1:28: fatal error: QCoreApplication: No such file or directory
 #include <QCoreApplication>
                            ^
compilation terminated.
Makefile:287: recipe for target 'main.o' failed
make: *** [main.o] Error 1
pi@raspberrypi:~/TestConsole $ 
Here's the generated Makefile if needed : https://gist.github.com/anonymous/3835aaa3b0e83c3d6183 I also tried:
export QT_SELECT=qt5 instead of export QT_SELECT=5 but it doesn't help.

User avatar
topguy
Posts: 7147
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: qmake: could not exec '/usr/lib/arm-linux-gnueabihf/qt4/

Fri Jan 08, 2016 10:48 am

Why are you running "qmake" with sudo ? (that could mess up environment variables, not sure)

Using full path to qmake should work and it looks like it does.

And yes you will have to install the development files for the Qt5 modules you want to use, I guess "qtbase5-dev" is a good start.

arduinian
Posts: 3
Joined: Wed Jan 06, 2016 9:09 am

Re: qmake: could not exec '/usr/lib/arm-linux-gnueabihf/qt4/

Tue Jan 12, 2016 7:14 am

Topguy, I suppose you're correct in that I was missing qtbase. I will come back to this and post my result once I install qtbase.
For now, I am using a native build base on https://wiki.qt.io/Native_Build_of_Qt5_ ... spberry_Pi

Thank you once again!

User avatar
topguy
Posts: 7147
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: qmake: could not exec '/usr/lib/arm-linux-gnueabihf/qt4/

Tue Jan 12, 2016 3:42 pm

If you use your own build of Qt then you should use the qmake from that build also.

Return to “General programming discussion”