Qt qDebug() doesn't work in Windows shell

2019-06-22 13:38发布

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?

2条回答
The star\"
2楼-- · 2019-06-22 14:06

You have to add

CONFIG += console

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

查看更多
Viruses.
3楼-- · 2019-06-22 14:13

Run your application with

application.exe > log.txt 2>&1

It redirects stderr to stdout and stdout to a file.

查看更多
登录 后发表回答