Solved Compilation error - moc.exe missing
-
Hey Qt mates
I have no idea what hell lured me to try "Analyze" option, but since then I can't compile my project - I get error:
/MinGW/msys/1.0/bin/sh.exe: C:QtQt5.11.15.11.1mingw53_32binmoc.exe: command not found
Yeah, I noticed there are / or \ missing.
I don't do cross compilation, I checked everything I could in Build & Run > Kits, %PATH% etc, and have no idea what's wrong. Have reinstalled Qt entirely, yet the error still persists.
Any hints how to solve?Qt 5.11.1, Qt Creator 4.6, OS Windows 7.
-
Removed both entries (C:\mingw\bin and C:\MinGW\msys\1.0\bin), but it doesn't solve the issue. Renaming sh.exe to sh2.exe helped, though.
But I'm more interested what is the root cause, as this is rather a bandage solution. Compilation worked for months smoothly, alongside with that MinGW installed, and only recently it broke out of arse, when I tried to use profiling tools located in "Analyze" menu. Maybe a bug in Qt Creator or Qt?? -
@MasterBLB Did you try to delete build folder, run qmake and build?
-
Of course.
I have even started a fresh project, and copied source files (.h, .cpp and .ui) into it and still NOPE. -
Hi,
From the look of the error, I would say that it might be the msys shell that is wreaking havoc.
How did you install Qt ?
How did you setup your Kit and Qt version ? -
I used qt-opensource-windows-x86-5.11.1.exe offline installer, and when asked to choose component I selected MinGW 32 only, and installed MinGW 5.3.0 as well.
Kit setup
-
@MasterBLB said in Compilation error - moc.exe missing:
/MinGW/msys/1.0/bin/sh.exe
Did you install any other MinGW or MSYS and have them in your PATH?
-
Only the one provided in the qt package, and yes, there are paths to mingw folder in PATH.
-
@MasterBLB said in Compilation error - moc.exe missing:
Only the one provided in the qt package, and yes, there are paths to mingw folder in PATH.
Can you try to remove them? Creator sets up it's PATHs automatically for compiling and running.
-
Removed both entries (C:\mingw\bin and C:\MinGW\msys\1.0\bin), but it doesn't solve the issue. Renaming sh.exe to sh2.exe helped, though.
But I'm more interested what is the root cause, as this is rather a bandage solution. Compilation worked for months smoothly, alongside with that MinGW installed, and only recently it broke out of arse, when I tried to use profiling tools located in "Analyze" menu. Maybe a bug in Qt Creator or Qt?? -
@MasterBLB Did you log off and on after changing PATH?
-
Not only logged off, but after next log on I used in cmd "set > variables.txt" to ensure C:\MinGW paths are removed. And yes, PATH looks good, the only MinGW entries are these:
C:\Qt\Qt5.11.1\5.11.1\mingw53_32\bin;C:\Qt\Qt5.11.1\Tools\mingw530_32\bin\
-
@MasterBLB For MinGW to work with Qt you do not need any MinGW entries in your PATH at all