0
votes

I have installed Qt 5.6 with Creator. I have a simple Qt project which I am trying to 'make'. If I run qmake && make while in the project directory I get the following result:

qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory

I found several posts online that suggested installing qmake for QT4 to resolve this, using:

sudo apt-get install qt4-qmake 

I actually did this and it seemed to get Qmake working, but the make process failed with

make: /usr/lib/x86_64-linux-gnu/qt4/bin/moc: Command not found     
Makefile:190: recipe for target 'main.moc' 
failed make: *** [main.moc] Error 127

So it seems to not find moc in the environment. I "think" this is because I am running qmake for version 4 but I actually have version 5.6 of Qt installed. I have since removed qt4-qmake and i have the original error again.

So my question is this: if i have Qt 5.6 installed (which is required for the Qt libraries I am using), why is it looking for version 4 qmake and how can I get qmake to recognize my version 5.6 install?

Update 1

So I can run qmake from within Qt Creator, but it doesnt create a makefile file in the project directory. If I run the debugger in Qt Creator, I can see where Creator runs qmake and make from and I can see it is successful. But I see no files that it creates as a result. Does running the project in Qt Creator result in any files being created, and if so where?

Update 2

I updated the project details on the project tab in Qt Creator. Strangely it doesnt save to there by default. Mow running QMake in Creator creates the file in the right folder.

1
Try qmake-qt5 instead.G.M.
I tried qmake-qt5 (and qt5-qmake) but neither is recognised as a valid executable...."command not found". As mentioned in the update qmake works from CreatorLee Melbourne
"If I run qmake && make while in the project directory I get the following result:" How do you run qmake? From a separate terminal window, or inside Qt creator? I think it's a path issue, where the wrong qmake is selected (NB: I think you should also remove qmake-qt4 i you do not plan on writing Qt4 applications)JvO
What is your OS?eyllanesc
I am running Ubuntu 17.04 with Qt 5.6Lee Melbourne

1 Answers

1
votes

In the projects tab, is shadow build ticked ? If yes, that's why the makefile doesn't appear in the project folder.

Usually you run qmake from the Qt creator because it's way more convenient.