CreateProcess: No such file or directory

Viewed 177586

I am getting this error whenever I try to run GCC outside of its installation directory (E:\MinGW\bin).

So, let's say I am in E:\code and have a file called one.c. Running: gcc one.c -o one.exe will give me this error:

gcc: CreateProcess: No such file or directory

The only workaround is to navigate to its installation directory, run gcc from there, and specify all the other paths. My environmental variable Path contains E:\MinGW\bin.

Any suggestions to fixing this problem? I am running Windows XP SP3.

25 Answers

Was getting the same error message when trying to run from Cygwin with links to the mingw install.

Using the same install of mingw32-make-3.80.0-3.exe from http://www.mingw.org/wiki/FAQ and the mingw shell option from Start -> Programs -> on a WinXP SP3 and gcc is working fine.

I had this same problem and none of the suggested fixes worked for me. So even though this is an old thread, I figure I might as well post my solution in case someone else finds this thread through Google(like I did).

For me, I had to uninstall MinGW/delete the MinGW folder, and re-install. After re-installing it works like a charm.

It looks like there are a couple of release distro for MinGW. Which one did you try? For the record, I ran into the exact same problem as the OP and the distro I got was from TDM-GCC 4.5.1.

I found the MinGW distro here seems to work far better and sets things up correctly. So for anyone running into this retarded 'createprocess-no-such-file-or-directory' error and can't get things to work, uninstall your existing MinGW and try the one I linked instead.

For me this error started occurring when the length of the command line exceeded cygwin's limit. Which was 32000 bytes.

You can check the limit using this command:

$ getconf ARG_MAX
32000

The solution in the project I am working has not been finalized yet, but possible solutions include:

  • using binaries built from link libraries instead built from all the project files.
  • shortening the names of directories that contain many source code files, as the names of the directories are repeated multiple times.
  • reviewing the list of files used by the linker.

Likely there are many more possible solutions too, the simplest perhaps is finding a way to increase the length limit.

Its specifically told that you need to reboot after you set the environmental variables in windows for migwin.

Related