问题
With QtCreator 2.8 under Win7 with CDB debugger, I cannot see in the Application Output tab all my fprintf(stdout) stuff !?
I tried:
fprintf(stderr, "...");
fprintf(stdout, "..."); fflush(stdout);
Nothing happens. In the meantime, If I check the "Run in terminal" option, it works !?
Although I noticed that all the output go to debugger log !?
Any idea ?
回答1:
As a workaround you can enable the output in CDB console: tools/options/debugger/cdb then check "Use CDB console". To show the debugger, right click on some window header and select "Debugger Log". You may also right click on the debugger log view to disable the verbose log. Btw, I also noticed that the standard application output window works well when you "attach to the running process" instead of starting it from qtcreator.
回答2:
I often use qDebug this way.
#include <QDebug> in the top of the file
Usage:
qDebug() << "This is a Test";
It runs well when using QT creator and does not matter in GUI programming or Console Application.
来源:https://stackoverflow.com/questions/17389157/no-application-output-in-qtcreator-debug