"No such file or directory" error in CodeBlocks

Got it finally:

In my case, the problem resulted from a program called EGCS (Experimental/Enhanced GNU Compiler System). I installed it as a prerequisite for PSCAD(Power Systems CAD) along with a FORTRAN Compiler. Just remove it, and you'll be fine.
(Sadly, I deleted the entire PATH environmental variable due to a mistake. So what?...I ended up installing a new Win7 but after uninstalling my Ubuntu which again due to the Boot difficulties which resulted from uninstalling GRUB, I again ended up messing around with fixmbr and fixboot fellas(But I've lost my Laptop DVD!)...In summary, The EGCS laughed at me for a 0.5*MONTH...)

For more information about such problems visit here(Code::Blocks Forum)


Codeblocks seems to be calling gcc correct -- I'm not seeing anything wrong with the way it's being invoked. The error message you're getting:

gcc.exe: error: CreateProcess: No such file or directory

indicates that there is something wrong with your installation of mingw-gcc. Since you said that this was working previously, that likely means some files required for gcc to function are either corrupted, inadvertently renamed, moved elsewhere or accidentally deleted.

In fact, I was able to reproduce that exact error by renaming cc1.exe. This is the C compiler that gcc needs to able to compile a C source file. On my install for Mingw-4.6.3, this resides under ./libexec/gcc/i686-w64-mingw32/4.6.3. Yours may be different depending on which mingw version and variant you're using.

I recommend downloading and reinstalling your copy of gcc altogether since fixing this manually can be tricky.


The answers here failed to solve my problem! My friend got it fixed for me. The solution was pretty simple and straight forward. The problem that occurred was that compiler couldn't chain itself with the MinGW (Minimalist GNU for Windows) which could have been modified by some other make files for makefiles softwares like CMake etc. So the solution is:

  1. Open Codeblocks and in the top Tool Bar select the Settings option and under that select the compiler option.
  2. It will open the Compiler Setting Window. Here select the Global Compiler settings(with a Gear Symbol) and in the sub-options select the Toolchain executables option.
  3. Under this select the Compiler's installation directory. Here browse files to select: C:\Program Files(x86)\Codeblocks\MinGW\bin
  4. Now select the Auto-detect option on the right.

It should solve your problem and I hope you got an understanding of what the problem was!!! Happy Programming!

Tags:

C

Codeblocks