I have installed MinGW C compiler in Windows 8 (64 bit) through the GUI installer.
But when I try to compile a C program, gcc says: gcc: CreateProcess: No such file or directory
It is a common bug, and I have tried all the solutions I found, without success.
In particular, (following CreateProcess: No such file or directory) I have tried to:
- [EDITED] Add C:\MinGw\libexec\gcc\mingw32\4.7.2 to my system PATH
-
Uninstall and re-install gcc through mingw-get CLI:
mingw-get remove mingw32-gcc
mingw-get install mingw32-gcc
Other suggestions?
EDIT: verbose gcc output:
> gcc -v helloWorld.c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.7.2/lto-
wrapper.exe
Target: mingw32
Configured with: ../gcc-4.7.2/configure --enable-languages=c,c++,ada,fortran,obj
c,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgo
mp --disable-win32-registry --enable-libstdcxx-debug --disable-build-poststage1-
with-cxx --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.7.2 (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=i386' '-march=i386'
cc1plus -quiet -v -iprefix c:\mingw\bin\../lib/gcc/mingw32/4.7.2/
OPTIONS.C -quiet -dumpbase OPTIONS.C -mtune=i386 -march=i386 -auxbase OPTIONS -
version -o C:\Users\elvis\AppData\Local\Temp\cc4fWSvg.s
gcc: error: CreateProcess: No such file or directory
You shouldn’t add
C:\MinGw\libexec\gcc\mingw32\4.7.2to the path.Add:
c:\MinGW\binYou may need to reboot to ensure that the path is made available to all processes properly.
Another suggestion is to use a different MinGW distribution. It’s been a long time since I used an ‘official’ MinGW distribution because the installation steps were so byzantine and fragile. I’ve heard they’ve made large advances to the installer, but from what I hear it still seems to be rather complicated and fragile.
TDM’s installer just works, but I think the TDM release isn’t quite to 4.7.2.
The nuwen distribution’s installation is just unpacking an archive where you want the thing (I love that!) and making sure the path points to the location of gcc.exe. Nuwen also packages the boost libraries, which is nice.
I case it helps, here’s what I get from
gcc -v hello.c(c:\mingw.4.7.2\binis in the path`):