News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Compiler and debugger settings for code::blocks on a Mandriva One 2010.2 machine

Started by milarze, May 22, 2011, 12:39:08 PM

Previous topic - Next topic

milarze

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!

oBFusCATed

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!]

Jenna

Quote from: 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.
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.

milarze

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!

Jenna

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.

milarze

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!

Jenna

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.

milarze

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.

stahta01

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

Jenna

Quote from: stahta01 on May 30, 2011, 04:14:53 AM
Verify the project is using the correct compiler.

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