Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt qDebug() doesn't work in Windows shell

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?

like image 211
Knight of Ni Avatar asked Nov 17 '12 14:11

Knight of Ni


2 Answers

You have to add

CONFIG += console

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

like image 82
tro Avatar answered Oct 13 '22 19:10

tro


Run your application with

application.exe > log.txt 2>&1

It redirects stderr to stdout and stdout to a file.

like image 3
Milanka Avatar answered Oct 13 '22 20:10

Milanka