g++: error: CreateProcess no such file or directory

扶醉桌前 提交于 2020-01-15 04:05:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!