Author Topic: Compiler and debugger settings for code::blocks on a Mandriva One 2010.2 machine  (Read 8965 times)

Offline milarze

  • Single posting newcomer
  • *
  • Posts: 5
Hello all! This is my first post here.

I have a problem with compiling programs i write in cb. It has to do with the settings i believe. When i try to compile the sample program, i get the message:
Quote
"etc - Debug" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
Nothing to be done.

So I went to the toolchain executables panel in the compiler and debugger settings. I am using the GNU GCC Compiler. Can anyone tell me what the settings should be? As in what the C compiler, C++ compiler, linkers, debuggers, resource compiler, and make program should be? Names of the programs? I think I am using gcc 4.2 version, but I dont really know how to check that.  :?

Thanks!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Type "gcc --version" and "g++ --version" in a terminal.
The defaults should be OK on all linuxes, so you do not need to do any changes.
Just check if the compiler/debugger is installed.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Type "gcc --version" and "g++ --version" in a terminal.
The defaults should be OK on all linuxes, so you do not need to do any changes.
Just check if the compiler/debugger is installed.
And check whether it's in /usr/bin or in (e.g.) /usr/local/bin.
In the second case, you have to fix the "Compiler's installation directory" accordingly.

Offline milarze

  • Single posting newcomer
  • *
  • Posts: 5
I have these settings now:
C Compiler: gcc4.2
C++ Compiler: g++4.2
Linker for dynamic libs: ld
Linker for static libs: ld
Debugger: gdb
Resource compiler: gdb
Make program: make

I have gcc4.2 installed, and the executable file for that is in ¨/usr/bin¨ as are all the others: ld, gdb, g++4.2, and make. Does invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] in the error message mean that I am using a compiler that cannot be used in my version of linux?

Thanks!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Are you sure the executable is called gcc4.2 and not gcc-4.2 ?
You can use the little button at the right of the textbox to chose the executable to be sure.

Offline milarze

  • Single posting newcomer
  • *
  • Posts: 5
yes, i used the little box at the side of the text box to find the files. it was in the directory /usr/bin. it also had the symbol for an executable file. but now i think the problem is actually with my compiler, because when i try compiling in command line, i am told the the command g++ does not exist. but i suppose this is not a cb problem, so i'll have to ask it elsewhere.

thanks!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Do you have g++ installed ?
On many linux distros it is in an own package and will not be installed automatically together with the c-compiler.

Offline milarze

  • Single posting newcomer
  • *
  • Posts: 5
i do have the g++4.2 file in the /usr/bin directory, and the package gcc4.2-c++ is shown as installed in my software management. so i do believe i have it installed.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Verify the project is using the correct compiler.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Verify the project is using the correct compiler.

Tim S.
Do the same for the targets (they can use different compilers).