Reputation: 881463
I recently installed Qt Creator 2.5 on my Debian box and created a simple console project to test it. The program it generated was modified to become:
#include <iostream>
//#include <QCoreApplication>
int main(int argc, char *argv[])
{
char junk;
//QCoreApplication a(argc, argv);
std::cout << "Hello there\n";
std::cin >>junk;
return 0;//a.exec();
}
(all the things commented out are simply what the creator gave me, I've removed them to simplify it as much as possible).
Now, when I run the built executable from the command line, it works fine, outputting the hello
message and then waiting for me to enter a character, after which it exits.
However, within Qt Creator itself, running with CTRL-R or debugging with F5 results in a blank window appearing and the only thing I can do is CTRL-C to break out of it:
(ignore that breakpoint on line 8, removing it has no effect on the behaviour).
The project file is as follows:
QT += core
QT -= gui
TARGET = xyzzy
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
What could be causing this behaviour?
My understanding was that the I
in IDE
stood for "integrated" so I don't really want to have to go and debug my code with gdb
on the command line :-)
I'm pretty certain it's not a flushing issue since, if I actually enter a character, nothing happens.
If I haven't provided enough info for the Qt Creator gurus out there, please let me know and I'll add it to the question.
Upvotes: 1
Views: 75
Reputation: 11822
Try to change the terminal value from x-terminal-emulator -e to xterm -e in Tools / Options... / Environment / General / Terminal:.
Upvotes: 1