Author Topic: CodeBlocks wont compile  (Read 7343 times)

Offline MoonlitKnight

  • Single posting newcomer
  • *
  • Posts: 7
CodeBlocks wont compile
« on: October 29, 2010, 07:43:27 pm »
Hi, I'm new to codeblocks but not to C. When trying to compile a program I get the following message in the build log:

Compiling: getrow.c
Execution of 'gcc.exe -Wall  -O2     -c "C:/Users/Utente/Documents/Nots and Crosses/getrow.c" -o obj/Release/getrow.o' in 'C:\Users\Utente\Documents\Nots and Crosses' failed.
Nothing to be done.

I think this has something to do with the compiler?

HELP!

Cheers

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: CodeBlocks wont compile
« Reply #1 on: October 29, 2010, 07:54:21 pm »
Whid do you think executing the compiler has nothing to do with the compiler ?

Your post lacks some information:
OS (it's windows I see, but which) ?
Which compiler is installed (version) ?

Are you able to compile from commandline ?
Does it happen always if you try to compile (did you try a simple hello-world-project created by the wizard) ?
Dou you have multiple instances of MinGW installed ?

Offline MoonlitKnight

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks wont compile
« Reply #2 on: October 29, 2010, 09:03:58 pm »
Whid do you think executing the compiler has nothing to do with the compiler ?

Your post lacks some information:
OS (it's windows I see, but which) ?
Which compiler is installed (version) ?

Are you able to compile from commandline ?
Does it happen always if you try to compile (did you try a simple hello-world-project created by the wizard) ?
Dou you have multiple instances of MinGW installed ?

OS is windows vista. Compiler is Cygwin GCC. Im not sure what version but it came from the codeblocks website included with codeblocks. The version i downloaded is codeblocks-10.05-setup.exe. I dont know how to compile from commandline (bit of a noob).
Simple hello world programs dont compile either, they give the same message.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: CodeBlocks wont compile
« Reply #3 on: October 29, 2010, 09:13:58 pm »
Quote
Cygwin GCC

NOTE: Code::Blocks, for windows, is sometimes packaged with the MinGW GCC NEVER with Cygwin GCC.

Did you install the Cygwin GCC C/C++ Compiler?
If not, why do you think it is installed?
If yes, which version of Cygwin GCC C/C++ compiler was installed?

Please turn on Full Compiler Logging
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Please find out which compiler you are using for your project.

Tim S.
« Last Edit: October 29, 2010, 09:16:34 pm 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 MoonlitKnight

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks wont compile
« Reply #4 on: October 29, 2010, 09:39:44 pm »
Sorry for being a bit hopeless. I installed no compliler. The site said it would be ready to go after installation. I assumed i was using Cygwin GCC because that was set under build options the first time i checked. Maybe i could download and install a compiler and that would fix it?

Offline MoonlitKnight

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks wont compile
« Reply #5 on: October 29, 2010, 09:40:32 pm »
I set up full command line.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: CodeBlocks wont compile
« Reply #6 on: October 29, 2010, 10:08:58 pm »
"Full command line" option Under menu "Settings" -> "Compiler and Debugger" -> Global compiler settings
Selected Compiler as "GNU GCC Compiler" and click "set as default"

Create a new hello world project and see if it works.

If it fails try auto detect
http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler#Compiler-neutral_setup_steps

Tim S.
« Last Edit: October 29, 2010, 10:11:06 pm 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 MoonlitKnight

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks wont compile
« Reply #7 on: October 29, 2010, 11:00:06 pm »
It failed. But the error message is gone. Now i click build and it doesnt do anything. Should i download GNU GCC and install?

Offline tanq

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: CodeBlocks wont compile
« Reply #8 on: October 29, 2010, 11:50:30 pm »
>Should i download GNU GCC and install?
Yes, if it's not done yet :)

For windows platform find any of "mingw" builds without "cygwin" word in title. Unpack it in any folder and point correct path and executable names in c::b compiler settings

Offline MoonlitKnight

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks wont compile
« Reply #9 on: October 30, 2010, 01:29:46 pm »
>Should i download GNU GCC and install?
Yes, if it's not done yet :)

For windows platform find any of "mingw" builds without "cygwin" word in title. Unpack it in any folder and point correct path and executable names in c::b compiler settings

Downloaded MinGW Minimalist GNU for windows at this site: http://www.mingw.org/wiki/Getting_Started.
Installed in C:\MinGW. Compiler set to GNU GCC compiler. In toolchain executables Installation directory is C:\MinGW, C compiler i set to gcc.exe but ive tried mingw32-gcc.exe aswell. I keep getting the following error message:

Compiling: C:\Users\Utente\Desktop\Untitled101.c
gcc.exe: CreateProcess: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

Btw if you've had enough its fine. I'm losing my patience with this
 

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: CodeBlocks wont compile
« Reply #10 on: October 30, 2010, 02:13:13 pm »
I suggest using either TDM's installer http://tdm-gcc.tdragon.net/, or the C::B installer, that include MinGW (it's the one with mingw in the name).

If you install MinGW in any directory other than x:\MinGW (where x is any drive), like C::B's installer does, you have to remove all x:\MingW directories, or you will run into trouble sooner or later.
After that yoiu should try to autodetect the installation-directory again (in Toolchain executables), if it does not work, you have to set it manually and make sure all exe's exist.

Offline MoonlitKnight

  • Single posting newcomer
  • *
  • Posts: 7
Re: CodeBlocks wont compile
« Reply #11 on: October 31, 2010, 05:56:05 pm »
Done and it works! Thank you soo much man!

Cheers!