问题
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.
回答1:
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
回答2:
Maybe you need to set the terminal to lunch the console applications. It can be done in the general environment settings.
来源:https://stackoverflow.com/questions/7554836/codeblocks-console-app-wont-show-output