问题
I get the following error:
g++: error: CreateProcess no such file or directory
whenever I try to compile a program. I have installed the MinGw 7.2 version at work on a windows machine and the problem does not occur, however after installing Windows SP3 on my home computer I get this error and I just can't figure it out since I have set all the environment variables properly. I even tried setting the path to C:\MinGw\libexec\gcc\i686-mingw32\4.6.1
where cc1plus.exe and cc1.exe are located but still no luck.If i type this at the command line:
_assoc .cpp=cpls
_ftype cpls=g++ "%1" %*
_program.cpp
it seemse to compile since I get compile time errors for the C++11 keywords which aren't recognized without the -std=c++0x switch. Any suggestions? Thanks in advance.
回答1:
I had this error and I tried reinstalling MinGW, changing Path, etc
Finally, Removing the GCC_EXEC_PREFIX env variable made from the Environment variable for both User and System made it work! And this was also the root cause of the reason why CMake said C compiler identification is unknown. In my case I think it was because Qt ships with its own MinGW. That could be the reason for you too (ie, mingw already exists elsewhere)
回答2:
You're compiling a 32 bit binary and trying to run it on a 64 bit system.
Compile the binary for the 64 bit architecture and it should work fine :)
http://www.drangon.org/mingw/
来源:https://stackoverflow.com/questions/7973995/g-error-createprocess-no-such-file-or-directory