User forums > Using Code::Blocks

C Console App and GCC Linking

(1/1)

r0xtehem0x:
I'm on Ubuntu 9.10 and just installed C::B 8.02.  I used the wizard to make a C console application (not C++).  When I went to compile my project, the files compiled properly except they wouldn't link.


--- Code: ---Linking console executable: bin/Debug/myShell
/bin/sh: g++: not found
Process terminated with status 127 (0 minutes, 0 seconds)
0 errors, 0 warnings

--- End code ---

Why is C::B defaulted to set up to use g++ on a C application?

Anyway, I have been searching to change the linking options of a project, but cannot find it.  I want to change code blocks to use gcc -o instead of g++.

Jenna:
It's set up in "Settings -> Comiler and debugger... -> Global compiler settings -> [the_compiler_you_use] -> Toolchain executables".

But be aware:
if you use gcc for linking, you might not be able to link c++-apps.
The better way is to install g++ also (it's in a seperate package).

Otherwise, you might run into trouble, if you decide to develop c++ apps in the future and have changed the linker-executable to gcc.

r0xtehem0x:
Thank  you, that is what I needed.
I was just curious on why code blocks doesn't have separate settings for C linker and C++ linker.  I guess it doesn't really matter when you have g++ installed.  For a situation though where you have gcc installed but not g++ on a computer where you don't have administrative rights to install new apps there may be a problem.  Although, I guess it would be up to the administrator to make the changes to code blocks to get it to link correctly with gcc and not g++.

Jenna:

--- Quote from: r0xtehem0x on November 17, 2009, 09:21:15 am ---Although, I guess it would be up to the administrator to make the changes to code blocks to get it to link correctly with gcc and not g++.

--- End quote ---

The settings are saved below the users home-directory (~/.codeblocks/default.conf).

Navigation

[0] Message Index

Go to full version