No application output in QtCreator debug

喜欢而已 提交于 2019-12-23 07:03:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!