7

I've got an application in Code::Blocks, and it's the simple Hello, World traditional program.

#include <iostream>

int main() {
    std::cout << "Hello, World!" << std::endl;
}

The program builds and executes, but the output isn't shown. I checked the project properties in Code::Blocks and it is definitely set to console application. Any suggestions as to the problem?

Edit: The output only fails in the IDE. When run separately the resulting executable functions exactly as expected.

10
  • 2
    Maybe a silly question: Is the 'Pause after execution' checked? (It's under Type dropdown list) Commented Sep 26, 2011 at 12:18
  • I suggest run .exe (or binary output) in shell and check the output Commented Sep 26, 2011 at 12:23
  • I had the same problem when I installed mine, I'll try to remember but I was able to fix it quite easily. Commented Sep 26, 2011 at 12:24
  • 3
    Not sure if anyone is still having this problem but for me it was AVG shield was blocking it. Added the folder that my projects were in to the list of exceptions and it works fine now. Hopefully this will save someone out there a little time Commented Feb 2, 2013 at 23:02
  • 2
    I was not able to figure out the problem- I uninstalled C::B and used VS instead. I was not running an antivirus. Commented Jul 7, 2015 at 15:11

3 Answers 3

8

It's possible that you don't have xterm installed it.

If you are on Linux (Debian flavor) you can install it with your package manager like so:

sudo apt-get install xterm

Sign up to request clarification or add additional context in comments.

Comments

0

Maybe you need to set the terminal to launch the console applications. It can be done in the general environment settings.

Comments

-1

I had this problem but it went away after I shut code blocks down and restarted. I also shut down without saving changes to the perspective (if that matters). It may be important that it happened right after I made an empty project and tried to make that empty project into a c++ console application. When that didn't work I made a "console application" project (with the hello world) but it wouldn't show the console either.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.