Code::Blocks Forums

User forums => Help => Topic started by: zorglub! on June 17, 2009, 07:06:19 pm

Title: How to force CB to point to the right compiler
Post by: zorglub! on June 17, 2009, 07:06:19 pm
Hi guys

I have a strange CB behaviour...
I'm trying to compile a piece oc C code...( source file is xxxx.c)
I have, by default, Gcc as default compiler..
So far, so good but when I launch CB, I'm getting an error 127 and a g++ not found message !!!

g++ to compile C stuff...!!!  should have been gcc instead

Something must be pointing to the wrong compiler and i'd like to know where to change it
Thks in advance
Title: Re: How to force CB to point to the right compiler
Post by: Jenna on June 17, 2009, 07:16:09 pm
Are you sure this happens at compile-time and not in linking stage ?

g++ is used as default linker in the standard-toolchain.

To see exactly what happens, you can turn on full commandline logging:
Change "Settings -> Compiler and debugger... -> Global compiler settings -> [the compiler you use] -> Other settings(rightmost tab)" "Compiler logging" to "Full commandline".
Title: Re: How to force CB to point to the right compiler
Post by: deadneurons on June 17, 2009, 07:20:00 pm
there is a, not very obvious arrow buttons  ' <    > ' on the left and right side of the compiler settings.
tick on the > until you see the Toolchain executables tab.

Title: Re: How to force CB to point to the right compiler
Post by: zorglub! on June 17, 2009, 11:36:00 pm
Hi guys

Aaaaaaargh  !!!
The solution was, just to make CB happy, to urpmi gcc-c++..;
Once g++ is installed, then gcc is found ...
U need to install the g++ stuff, even if you don't use it, to gain access to the  compiler that u use.. pretty weird  no !!
Title: Re: How to force CB to point to the right compiler
Post by: Jenna on June 17, 2009, 11:46:27 pm
As I wrote before, g++ is used as frontend to the linker and C::B always splits the build process in compiling and linking, so it can not work without it.

If you don't do anything but c-compiling and you absolutely don't want to install g++, you can use gcc for linking stage.
gcc can link c-files, but not c++-files, g++ can link both of them.
Title: Re: How to force CB to point to the right compiler
Post by: zorglub! on June 17, 2009, 11:58:34 pm
@jens

Got it...thks
Did not knew that g++ could do both...