Reputation:
#include <QCoreApplication>
#include <QDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
qDebug() << "hello";
return a.exec();
}
This basic application doesn't work when building and running in QtCreator 2.6.2. I'm using Qt 5.0.1.
Not even my program runs; the only thing that runs is qcreator_process_stub.exe
. In my .pro
file, the line CONFIG += console
is there, and in my .pro.user
file, UseTerminal
is set to true.
But my question is why my program doesn't show and what is qcreator_process_stub.exe
?
Edit: Standard output doesn't even show.
Upvotes: 3
Views: 7934
Reputation:
I found the problem.
QtCreator was detecting the wrong MinGW version on my system (as I used another version for Code::Blocks). What I did was:
Tools > Options... > Build & Run > Kits
I then cloned the Auto-detected kit, and changed the compiler to the one that shipped with QtCreator. Every time I create a project, I have to build it with that kit.
Upvotes: 0
Reputation: 19102
http://qt-project.org/doc/qt-5.0/qtcore/qdebug.html#details
qcreator_process_stub.exe
is the default terminal that Qt Console programs get executed in.
http://qt-project.org/doc/qt-5.0/qtcore/qtglobal.html#qDebug
This function does nothing if QT_NO_DEBUG_OUTPUT was defined during compilation.
Try putting this at the top of your main:
#ifdef QT_NO_DEBUG_OUTPUT
#undef QT_NO_DEBUG_OUTPUT
#endif
Upvotes: 2