Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code::Blocks console app won't show output

Tags:

c++

codeblocks

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.

like image 386
Puppy Avatar asked Sep 26 '11 12:09

Puppy


People also ask

How do you display output in Code::Blocks?

Originally Answered: How do I get output screen for code written in C++ in codeblocks? Press F9 on your keyboard,it builds and runs your program in Codeblocks.

Why is my Code::Blocks not working?

Is it because of the compiler? in here, tap Auto-detect in “Compiler's installation directory”, or tap '…' dots to manually assign the location for MinGW/bin/ folder where (c++.exe, gcc.exe etc) toolchains are located. If you've only downloaded codeblocks.exe setup, then you'll have to install compiler manually.


1 Answers

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

like image 142
Kamil Szot Avatar answered Sep 20 '22 00:09

Kamil Szot