简体   繁体   English

如何在Qt Windows中使用设置路径属性从命令行运行应用程序(.exe)时在命令行上打印日志

[英]How to Print logs on Command Line while running the application (.exe) from command line using set path property in Qt Windows

I am using Qt 5.5.1 windows/Linux. 我正在使用Qt 5.5.1 Windows / Linux。 I have a .pro file in my project folder. 我的项目文件夹中有一个.pro文件。 Inside that project folder, Qt IDE creates a .exe application file after building my project. 在该项目文件夹中,Qt IDE在构建我的项目后创建一个.exe应用程序文件。 Now as I go inside the debug folder from Command Line, I do 现在,当我从命令行进入调试文件夹时,

 set path="C:\Qt\Qt5.5.1\5.5.1\mingw48_32\bin" 

Then, I try : 然后,我尝试:

START /WAIT myapplication.exe

In my project, I am using statements such as: 在我的项目中,我使用如下语句:

QDebug()<<"My logs are not getting displayed";
printf("My logs are not getting displayed");
system("Please do something");

Nothing is getting displayed on my running command line. 我正在运行的命令行没有任何显示。 Please help me regarding the same. 请同样帮助我。

This line is not correct. 这行是不正确的。

QDebug()<<"My logs are not getting displayed";

This should works: 这应该工作:

qDebug()<<"My logs are not getting displayed";

And this should works but don't use it in few threads at same time: 这应该可行,但不要同时在几个线程中使用它:

QTextStream(stdout)<<"My logs are not getting displayed";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM