Qt 5.4.1 : cannot find moc.exe
-
wrote on 20 May 2015, 07:16 last edited by
On a working Win7/Qt5.4.1 environnement, I suddenly have the following error :
/usr/bin/sh: C:\Qt\Qt5.4.1\5.4\mingw491_32\bin\moc.exe: command not foundWhen I look into this directory : C:\Qt\Qt5.4.1\5.4\mingw491_32\bin, the moc.exe binary file is there.
I tried running the same command from command line, I got another error.
Tried to uninstall/reinstall Qt5.4.1, I always have the same problem.Can anyone help me solve this issue, as I do not have any more idea to try by myself ?
Thanks,
Alain
-
wrote on 20 May 2015, 13:27 last edited by
I finally installed Qt 5.3.0 with mingw 4.8.2 (qt-opensource-windows-x86-mingw482_opengl-5.3.0) and it works with this version.
I'd like to understand, as I did not make any change to my Qt / mingw setup before it was broken... -
wrote on 20 May 2015, 13:43 last edited by
The only thing my eyes spot is the referenc to
/usr/bin/sh
. Of course in Win7 this leads tocommand not found
. Are you cross-compiling for linux? Ausr/bin/sh
should never be in a Makefile on pure Windows qmake. -
The only thing my eyes spot is the referenc to
/usr/bin/sh
. Of course in Win7 this leads tocommand not found
. Are you cross-compiling for linux? Ausr/bin/sh
should never be in a Makefile on pure Windows qmake. -
The only thing my eyes spot is the referenc to
/usr/bin/sh
. Of course in Win7 this leads tocommand not found
. Are you cross-compiling for linux? Ausr/bin/sh
should never be in a Makefile on pure Windows qmake. -
Hi and welcome to devnet,
When do you have that error ?
-
wrote on 21 May 2015, 12:04 last edited by
@SGaist Hi, I get this error as soon as I use the build command.
It started when I added a new SIGNAL/SLOT pair.
But with the same code, it works under Qt 5.3.0 and does not under Qt 5.4.1 (but it used to)
The difference between the 2 Qt versions is that Qt 5.4.1 uses mingw 4.9.1 instead of mingw 4.8.2
I checked, the moc.exe file is in C:\Qt\Qt5.4.1\5.4\mingw491_32\bin\ directory ... -
Since it used to work, what did change in between ? Did you modify the Kits ?
-
wrote on 22 May 2015, 07:14 last edited by
@SGaist
No, I don't think so.
But I also think there has been many days between I previously ran moc.exe.
In fact, I did not add any SIGNAL/SLOT since a very long time, so I didn't have to use the MOC
So, maybe my configuration changed (but how ?) -
What do you mean by "there has been many days between I previously ran moc.exe." ? Did you run it manually ?
-
wrote on 2 Jul 2015, 09:23 last edited by
Sorry for the long delay.
I'm just saying that I did not have to re-run moc.exe since I did not add any SIGNAL/SLOT nor touched the UI
So, I just built the app using Ctrl-B -
That's the thing: you don't run moc, you re-run qmake that will in turn setup the targets to run moc when you hit the build button.
-
wrote on 2 Jul 2015, 23:50 last edited by
The /usr/bin/sh is more than likely the issue. It looks like you used a pseudo linux environment in windows (msys/msys2/cygwin?) at some point to run the qmake and now are possibly trying to run in a pure window (cmd) environment.
I've done exactly that before where I had old Makefile's from when I used msys to build something, didn't clean up the build, and then tried with a pure cmd.
If you are in a faux-linux environment then the paths with the backslashes are the issue in finding moc as they should be c:/x/x/x/x at a minimum or in a msys /c/Qt/.../moc.exe.
Also I have seen issue with Qt claiming it can't find a binary when you have multiple versions of Qt installed and are mixing versions during a build. So check your pathing and QTDIR env var on that.