14

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 ?

Stef
  • 3,691
  • 6
  • 43
  • 58

4 Answers4

4

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.

Cyrion
  • 56
  • 2
  • Thanks for this comment. This does give you a lot of output, but not the output you expect as you run the executable from command line. – jaques-sam May 20 '19 at 15:14
0

Not an answer, just a comment that this is obviously a "feature" and isn't going to get fixed.

I've just started porting a C++/Qt project that has been developed under linux with GCC and Clang, and Windows 7 with MinGW GCC, to Windows 10 with MSVC. If my test code is run as individual programs it reports "All tests passed" (or not), to the console, (std::cout) which in this case is the Qt Creator Application Output window. It has been working on all systems, with all compilers, in both debug and release mode, for years. It now doesn't write to the Application output window when run via the debugger, only if run as if it was the release version.

On discovering this (2021-04-16), I Googled for the solution, and landed here.

Pete D.
  • 165
  • 1
  • 12
0

I know that this answer do not answer the original question, but since when searching for "No application output" we found this answer...

See the following answer: https://stackoverflow.com/a/26325743/808101. This only apply to qDebug() and similar functions (not direct output to stdout/stderr). In my case, I have to set QT_ASSUME_STDERR_HAS_CONSOLE environment variable to 1 in QtCreator in order to see qDebug() messages inside "Application Output" window. For older version of Qt see linked answer for old/deprecated environment variable.

benjarobin
  • 4,410
  • 27
  • 21
-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.

user2633954
  • 93
  • 1
  • 9
DarkPirate
  • 55
  • 1
  • 7
  • 6
    That's irrelevant here, the problem is the output is not displayed in QtCreator no matter what you use to write it. – kralyk Jul 07 '14 at 18:05