Code::Blocks Forums

User forums => Help => Topic started by: milarze on May 22, 2011, 12:39:08 pm

Title: Compiler and debugger settings for code::blocks on a Mandriva One 2010.2 machine
Post by: milarze on May 22, 2011, 12:39:08 pm
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!
Title: Re: Compiler and debugger settings for code::blocks on a Mandriva One 2010.2 machine
Post by: oBFusCATed on May 22, 2011, 01:24:25 pm
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.
Title: Re: Compiler and debugger settings for code::blocks on a Mandriva One 2010.2 machine
Post by: Jenna on May 22, 2011, 03:12:28 pm
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.
Title: Re: Compiler and debugger settings for code::blocks on a Mandriva One 2010.2 machine
Post by: milarze on May 26, 2011, 05:00:22 am
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!
Title: Re: Compiler and debugger settings for code::blocks on a Mandriva One 2010.2 machine
Post by: Jenna on May 26, 2011, 08:21:57 am
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.
Title: Re: Compiler and debugger settings for code::blocks on a Mandriva One 2010.2 machine
Post by: milarze on May 29, 2011, 06:36:30 am
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!
Title: Re: Compiler and debugger settings for code::blocks on a Mandriva One 2010.2 machine
Post by: Jenna on May 29, 2011, 09:03:05 am
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.
Title: Re: Compiler and debugger settings for code::blocks on a Mandriva One 2010.2 machine
Post by: milarze on May 30, 2011, 03:01:39 am
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.
Title: Re: Compiler and debugger settings for code::blocks on a Mandriva One 2010.2 machine
Post by: stahta01 on May 30, 2011, 04:14:53 am
Verify the project is using the correct compiler.

Tim S.
Title: Re: Compiler and debugger settings for code::blocks on a Mandriva One 2010.2 machine
Post by: Jenna on May 30, 2011, 06:42:09 am
Verify the project is using the correct compiler.

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