Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在屏幕上使用qDebug()Qt 框架。printf当我从 Qt Creator 运行应用程序时它工作得很好,但是当我尝试从 Windows 执行它时cmd它什么也没显示。为什么会这样?
qDebug()
printf
cmd
你必须添加
CONFIG += console
到您的项目.pro文件中,不要忘记清理和构建(重建)您的项目。
.pro
运行您的应用程序
application.exe > log.txt 2>&1
它将 stderr 重定向到 stdout 并将 stdout 重定向到文件。