Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.