Author Topic: PLEASE help me able to use Code::Blocks! :(  (Read 4528 times)

Offline drakeeeeeeee

  • Single posting newcomer
  • *
  • Posts: 3
PLEASE help me able to use Code::Blocks! :(
« 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!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: PLEASE help me able to use Code::Blocks! :(
« Reply #1 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).

Offline drakeeeeeeee

  • Single posting newcomer
  • *
  • Posts: 3
Re: PLEASE help me able to use Code::Blocks! :(
« Reply #2 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: PLEASE help me able to use Code::Blocks! :(
« Reply #3 on: March 06, 2011, 05:41:09 pm »
Does "g++ --version" typed in a console work?
(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 drakeeeeeeee

  • Single posting newcomer
  • *
  • Posts: 3
Re: PLEASE help me able to use Code::Blocks! :(
« Reply #4 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