Author Topic: gcc error while building  (Read 16494 times)

Offline Swashia

  • Single posting newcomer
  • *
  • Posts: 6
gcc error while building
« on: November 01, 2012, 12:16:55 am »
Hello,

When I tried to compile a new program, the build log gave me this error and it refused to compile.

Compiling: C:\Users\Swashia\Desktop\swashia\main.c
mingw32-gcc.exe: CreateProcess: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
My version of Code blocks is "codeblocks-10.05mingw-setup" which includes compiler

I tired to go to Settings/compiler and debugger/toolchain executables/ and press auto detect
but problem still persist.

It was working fine when last time I used code blocks. This problem seems to pop out of no where.

Any suggestion?

OS: WINDOW 7 64bit

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
Re: gcc error while building
« Reply #1 on: November 01, 2012, 12:28:10 am »
Suggestion 1: This is Windows, so try rebooting the computer.
Suggestion 2: Do not create programming projects on the desktop; it might not be allowed in Windows 7
Try doing it under your "Documents" folder instead.
Possible Problem 1: Some people have claimed that version of mingw (with CB 10.05) has issues with windows 7; I never noticed any but I use 32 bit Windows 7.
Possible problem 2: Anti-virus software can cause issues.

My guess is a bad installation of MinGW GCC; I would remove the current installation of MinGW GCC and install a newer copy of MinGW while I do it.
(Edit 1: A bad toolchain setup can also look like a bad GCC installation)
Edit2: Link to toolchain howto http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler#Compiler-neutral_setup_steps

NOTE: If you have a MinGW GCC installed on any drive root as in X:\mingw then that is THE only copy of MinGW GCC that will work in nearly all cases!!

Tim S.

« Last Edit: November 01, 2012, 12:30:37 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Swashia

  • Single posting newcomer
  • *
  • Posts: 6
Re: gcc error while building
« Reply #2 on: November 01, 2012, 01:21:18 am »
I tried to create a project on my document folder
I tried to reinstall CodeBlocks and installed compiler separately at C:/MinGw
I made sure toolchain auto detect MinGw at C:/MinGw
I made sure C:/MinGw is the only MinGw folder
I tried to disable my antivirus

and the problem still here

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: gcc error while building
« Reply #3 on: November 01, 2012, 01:26:09 am »
What does your full build log look like?

Offline Swashia

  • Single posting newcomer
  • *
  • Posts: 6
Re: gcc error while building
« Reply #4 on: November 01, 2012, 02:42:51 am »
mingw32-gcc.exe    -c C:\Users\Swashia\Desktop\swashia\main.c -o C:\Users\Swashia\Desktop\swashia\main.o
mingw32-gcc.exe: error: CreateProcess: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
Re: gcc error while building
« Reply #5 on: November 01, 2012, 03:19:10 am »
mingw32-gcc.exe    -c C:\Users\Swashia\Desktop\swashia\main.c -o C:\Users\Swashia\Desktop\swashia\main.o
mingw32-gcc.exe: error: CreateProcess: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 


From the windows command line try this.

Code
SET MINGWTOOLCHAIN=C:\mingw
SET CBPROJECTFOLDER=C:\Users\Swashia\Desktop\swashia

SET PATH=%MINGWTOOLCHAIN%\bin;%PATH%

CD /d %CBPROJECTFOLDER%
mingw32-gcc.exe -c main.c -o main.o


If you get an error post the error.

If it works then likely your MinGW GCC installation is OK.

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Swashia

  • Single posting newcomer
  • *
  • Posts: 6
Re: gcc error while building
« Reply #6 on: November 01, 2012, 03:55:16 am »
error  :(

C:\Users\Swashia\Desktop\swashia>mingw32-gcc.exe -c main.c -o main.o
mingw32-gcc.exe: error: CreateProcess: No such file or directory

change the folder to my document doesn't work neither


C:\Users\Swashia\Documents\Swashia>mingw32-gcc.exe -c main.c -o main
mingw32-gcc.exe: error: CreateProcess: No such file or directory
« Last Edit: November 01, 2012, 03:58:48 am by Swashia »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7590
    • My Best Post
Re: gcc error while building
« Reply #7 on: November 01, 2012, 04:33:57 am »
error  :(

C:\Users\Swashia\Desktop\swashia>mingw32-gcc.exe -c main.c -o main.o
mingw32-gcc.exe: error: CreateProcess: No such file or directory

change the folder to my document doesn't work neither


C:\Users\Swashia\Documents\Swashia>mingw32-gcc.exe -c main.c -o main
mingw32-gcc.exe: error: CreateProcess: No such file or directory


So, its not a Code::Blocks problem.

I guess that cause as bad MinGW installation, MinGW version not compatible with Win7, Win7 security setting issue, or Virus Scanner interference.

Edit: I changed the order from what I think is most likely first to least likely last.

Edit2: My guess depends on you really doing what I asked you to do; if the path was NOT set correctly then you could just have the path set wrong.

Tim S.
« Last Edit: November 01, 2012, 04:49:55 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Swashia

  • Single posting newcomer
  • *
  • Posts: 6
Re: gcc error while building
« Reply #8 on: November 01, 2012, 10:12:38 am »
I don't think it is window 7 problem since it was compiling fine before.

The path shouldn't be wrong neither
since Code Blocks could auto detect my installation of MinGW.

Does MinGW folder have to be in specific path?

Anti Virus doesn't seem to cause it.
 My other computer has same AV program installed and code blocks compile without complaining
« Last Edit: November 02, 2012, 03:26:33 am by Swashia »

Offline Swashia

  • Single posting newcomer
  • *
  • Posts: 6
Re: gcc error while building
« Reply #9 on: November 04, 2012, 01:22:08 am »
Solved

The problem is the program called  EGCS (Experimental/Enhanced GNU Compiler System). I don't know how it get here, but
I uninstall it and everything work fine.