2

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.

Community
  • 1
  • 1
Marius Pirvu
  • 45
  • 1
  • 1
  • 9
  • Do you have MinGW's 'w32api' package installed? If not, you need it. – ildjarn Nov 01 '11 at 23:50
  • To help you check whether this is a MinGW problem, or a problem with your files, have you tried compiling on another platform? The g++ error in the question is produced by g++ itself (so the problem is not that it can't find `cc1plus.exe` and friends). e.g. `g++ foo_bar_file_does_not_exist` produces a similar error for me (on a linux system with g++ on the path) – jelford Nov 01 '11 at 23:52
  • The files compile fine with the same version of MinGW http://nuwen.net/mingw.html on another windows machine so i don't see where the problem might be.I also have Ubuntu installed and i can compile fine. – Marius Pirvu Nov 02 '11 at 00:07

2 Answers2

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)

mehfoos yacoob
  • 408
  • 3
  • 9
  • 5
    I looked for that env variable but it wasn't defined. Anyway i solved the problem by defining the path to MinGW\bin first in the PATH env variable.(doesn't make sense but it worked) – Marius Pirvu Apr 06 '12 at 19:44
0

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/

matiu
  • 7,469
  • 4
  • 44
  • 48