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?
Asked
Active
Viewed 5,131 times
6

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 Answers
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
-
2Thanks. It works. I think I even tried this before, but didn't clean and build full project. – Knight of Ni Nov 17 '12 at 17:08
-
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