Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Compiler Error under Qt5.0.1-mingw for Windows 7 (x86_64) -- Compiler Seems To Ignore Directory Levels
When I attempt to build projects under Qt 5.0.1-mingw I get the following type of error -- for example, while compiling the "digital clock" example:
g++.exe: error: ..digitalclockmain.cpp: No such file or directory
The compiler appears to ignore the "" between "digitalclock" (the parent directory) and "main.cpp" the file. BTW, it happens on ALL of my projects, even ones that I've compiled before on earlier version of Qt.
Here is the full compiler line:
C:/Qt/Qt5.0.1/Tools/MinGW/bin/mingw32-make -f Makefile.Debug
mingw32-make: Entering directory 'C:/Users/Public/Documents/workspace/digitalclock-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug'
g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..\digitalclock -I"..\digitalclock\qtquick2applicationviewer" -I"..........\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -I"..........\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtQuick" -I"..........\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtQml" -I"..........\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtNetwork" -I"..........\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtGui" -I"..........\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtCore" -I"debug" -I"." -I"..........\Qt\Qt5.0.1\5.0.1\mingw47_32\mkspecs\win32-g++" -o debug\main.o ..\digitalclock\main.cpp
Does anyone have any thoughts on this issue or how to correct it? I've uninstalled and reinstalled Qt5.0.1-mingw several times. I did install Qt5.0.1-msvc2010 and can report that it doesn't happen under that compiler, but I'd rather stick with mingw32.
wakeuky last edited by
Check your environment variables. Ensure that you have updated them for 5.0.1. For example, mine looks like this:
PATH = C:\Ruby200-x64\bin;C:\Python33;D:\Qt\Qt5.0.1\Tools\MinGW\bin;
Remember, you may need to reboot for changes to propagate.
Path is already set with c:\Qt\Qt5.0.1\Tools\MingW\bin, so it's not a path issue. Besides, I'm not sure how a bad path would prevent the compiler from seeing the "" between the directory and the file name.
Hello, I have got the same thing. I am running windows 8
I have found my problem. The problem is caused by sh.exe of GIT utilities. After renaming the sh.exe, everything starts working. Hopefully, it will help anyone who has similar problem.
@Allen, I'll give it a try and report back. Where did you find that particular file? Was it in the mingw32 library or was it in your git utility (I assume something like Msys git bash).
This is how I found it: I added those missing slashes. In the end, it complains something related to sh.exe of GIT utilities.
@Allen, thanks! It worked for me as well.
FYI, I had 3 copies of the file "sh.exe" on my computer -- in /"Program Files (x86)"/Git/bin, in /cygwin/bin and in /MinGW/msys/1.0/bin. I only renamed the one in "Program Files (x86)" because that was the only one in my PATH statement, but left the other 2 unaltered. It may be that, depending on your PATH statements, that the others might be a problem as well. Only the /"Program Files (x86)"/Git/bin/ path was in my PATH statement, so it could be that QtCreator might object to the others if it could find them. Oddly enough, the version of MinGW installed by Qt5.0.1 does not contain sh.exe.