3

I installed code blocks, selected a GNU/gcc compiler, and created a new empty project and file. When I try to execute a basic Hello World program, no console window pops up and no errors are generated.

Neal
  • 887

3 Answers3

3

Actually Codeblocks has sometime a problem like the one you mention. what I do is click on New File and select Empty File or just press Shift+Ctrl+N and then SAVE the file with some name .cpp. Like example.cpp.

THEN you start writing the code for it. When finished press F9 for it to Build and Run.

IF by any chance you do not have g++ in your Ubuntu (In my ubuntu it does not come by default) just install it by sudo apt-get install g++ or better yet the build essential tools sudo apt-get install build-essential and close and open CodeBlocks.

Luis Alvarado
  • 211,503
2

I had a similar issue when g++ was not installed. Codeblocks actually uses g++, not gcc. Try installing the "g++" package.

Shnatsel
  • 1,188
2

You need to install the 'build-essential' package. Open a terminal and type: sudo apt-get install build-essential You can also install it with synaptic package manager or with the ubuntu software center.