Code::Blocks Forums

User forums => Help => Topic started by: drakeeeeeeee on March 06, 2011, 05:58:57 am

Title: PLEASE help me able to use Code::Blocks! :(
Post by: drakeeeeeeee on March 06, 2011, 05:58:57 am
I have been teaching myself C for a while using DevC++ (using Wine on Fedora), and I downloaded Code::Blocks and absolutely LOVE it, but one problem... I can't run any of my code!

I have GCC installed, so I know I have a compiler. When I run the same code (just a simple Hello World program) on DevC++ it works fine. I tried messing with the settings of CB, but it still didn't work, so I just un-installed and then re-installed, so all the settings are as they first are, but still nothing.

When I press 'Build and Run' it says 'It seems that this file has not been built yet. Do you want to build it now?', and when I press 'Yes', nothing happens except in the bottom left, highlighted in red it says:

Compiling: /home/drake/Desktop/My Codes/C/helloworld_wiki.c
Linking console executable: /home/drake/Desktop/My Codes/C/helloworld_wiki
/bin/bash: g++: command not found
Process terminated with status 127 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
But no 'black screen' comes up saying hello world! Please help, I really like Code::Blocks but I might as well just stick to DevC++ if it can't even output!
Title: Re: PLEASE help me able to use Code::Blocks! :(
Post by: Jenna on March 06, 2011, 09:47:37 am
C::B uses g++ for linking as default (because it can link C abd C++ files), but on linux gcc and g++ are normally in different packages, so you either have to install the g++ package also (recommended) or change the linker executable in the toolchain executables to gcc (not recommended, because if you switch to C++ later you will not be able to link the object files created witrh C++ without changing it again).
Title: Re: PLEASE help me able to use Code::Blocks! :(
Post by: drakeeeeeeee on March 06, 2011, 05:34:27 pm
I don't care about C++, I'm only into C. And I have downloaded both packages, G++ and GCC so I don't understand how to get Code::Blocks to recognize this.
Title: Re: PLEASE help me able to use Code::Blocks! :(
Post by: oBFusCATed on March 06, 2011, 05:41:09 pm
Does "g++ --version" typed in a console work?
Title: Re: PLEASE help me able to use Code::Blocks! :(
Post by: drakeeeeeeee on March 06, 2011, 05:43:35 pm
Wooooooooooooooooooooot!I GOT IT TO WORK! Thank you so much about telling me about the linker thing. I changed all the g++ to gccs, and it worked! ty tyty