User forums > Using Code::Blocks

C::B compiles in K&R C and not ANSI C...?

<< < (4/7) > >>

Jenna:

--- Quote from: LiK on May 19, 2009, 11:35:44 pm ---ok i enabled full-command-line logging but the message is exactly the same as above..

--- End quote ---

Please post the commandline !!!

rcoll:
Did you see my example above, where it showed the compiler being called?  Yours has it also (somewhere).  That is the command I need to see.

For the version number ... open the command window, then CD to the directory with the gcc compiler.  Then issue the command "gcc -v".  I need to know what version of gcc you  are using.

Ringo

LiK:
ok gcc version is 3.4.2 (mingw-special).

ok i see your line. its the build log. Here is mine
[ 50.0%] mingw32-g++.exe -pedantic -Wall -ansi -g    -c "C:\...\1.c" -o "C:\...\1.o"

it is using g++ instead of gcc.. why?
In compiler settings mingw32-gcc.exe is selected as default C compiler.
mingw32-g++.exe is selected for C++.

The file is blabla.c and when i create a new one i select C, not C++..


Thx

rcoll:
The g++ compiler of course expects all input files to be be C++ files; I'm not sure how you got to this point.

Go to Settings->Compiler and Debugger and on the "Selected Compiler" list select the compiler you are using (probably called GNU GCC Compiler), then click the tab called "Toolchain executables".  There will be both a C compiler and a C++ compiler listed there.  Make sure that "mingw32-gcc.exe" is listed for the C compiler.

Ringo

LiK:
Thing is that i did not change anything there..

yes i already checked there and its mingw32-gcc.exe as C compipler.

But for some reason it uses the mingw32-g++.exe compiler which is the selection for C++.

It will only work if i put mingw32-gcc.exe as C++ compiler(!)

Seems like it cannot see that my file is a C file (despite the fact that its .c)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version