6

I am using a qDebug() of Qt Framework for printf something on the screen. It works just fine when I run application from Qt Creator, but when I try to execute it from Windows cmd it shows nothing. Why that happens?

NG_
  • 6,895
  • 7
  • 45
  • 67
Knight of Ni
  • 1,780
  • 3
  • 20
  • 47
  • This has been asked several times in the past. I do not have more close votes for today, but if someone has, please see it as the duplicate of http://stackoverflow.com/questions/3360548/console-output-in-a-qt-gui-app – László Papp Nov 26 '14 at 10:47

2 Answers2

11

You have to add

CONFIG += console

to your projects .pro file and do not forget to clean and build (rebuild) your project.

NG_
  • 6,895
  • 7
  • 45
  • 67
3

Run your application with

application.exe > log.txt 2>&1

It redirects stderr to stdout and stdout to a file.

Milanka
  • 1,742
  • 19
  • 15