Qt 5.4.1 : cannot find moc.exe
-
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
-
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 ?
-
@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 ?
-
-
What do you mean by "there has been many days between I previously ran moc.exe." ? Did you run it manually ?
-
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.
-
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.