Author Topic: How to force CB to point to the right compiler  (Read 3655 times)

Offline zorglub!

  • Multiple posting newcomer
  • *
  • Posts: 11
How to force CB to point to the right compiler
« 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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to force CB to point to the right compiler
« Reply #1 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".

Offline deadneurons

  • Multiple posting newcomer
  • *
  • Posts: 39
Re: How to force CB to point to the right compiler
« Reply #2 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.


Offline zorglub!

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: How to force CB to point to the right compiler
« Reply #3 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 !!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to force CB to point to the right compiler
« Reply #4 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.

Offline zorglub!

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: How to force CB to point to the right compiler
« Reply #5 on: June 17, 2009, 11:58:34 pm »
@jens

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