News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

CodeBlocks wont compile

Started by MoonlitKnight, October 29, 2010, 07:43:27 PM

Previous topic - Next topic

MoonlitKnight

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

Jenna

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 ?

MoonlitKnight

Quote from: jens 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 ?

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.

stahta01

#3
QuoteCygwin 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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

MoonlitKnight

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?

MoonlitKnight


stahta01

#6
"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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

MoonlitKnight

It failed. But the error message is gone. Now i click build and it doesnt do anything. Should i download GNU GCC and install?

tanq

>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

MoonlitKnight

Quote from: tanq 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

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


Jenna

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.

MoonlitKnight

Done and it works! Thank you soo much man!

Cheers!