Puppy
Puppy

Reputation: 147054

Code::Blocks console app won't show output

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.

Upvotes: 7

Views: 24949

Answers (3)

Vigor
Vigor

Reputation: 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.

Upvotes: -1

amkrous
amkrous

Reputation: 1

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

Upvotes: 0

Kamil Szot
Kamil Szot

Reputation: 17817

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

Upvotes: 8

Related Questions