I'm having problem getting output of this simple program in the console in w2k. In Linux, no problem, I get the expected lines. Can anyone find a problem with this? Why isn't there any output?
Printable View
I'm having problem getting output of this simple program in the console in w2k. In Linux, no problem, I get the expected lines. Can anyone find a problem with this? Why isn't there any output?
Add "CONFIG += console" to your .pro file.
No need to create a QApplication or QCoreApplication?
No. The console is independent of Qt.
Thank you all! Your patience with all my problems is incredible.:)
I have a similar program(see below), and I do add "config += console" for qmake. but I can only get the first output but not the second output. Does anyone can help me?
Mingw 3.4.5 + Windows Vista Home
Code:
#include <QProcess> #include <QString> #include <QByteArray> #include <QTextStream> #include <QDebug> int main(int argc, char** argv){ out<<"[result]"<<endl<<flush; qDebug()<<"debug output"<<endl; QProcess* p; p->start("dir"); if (!p->waitForFinished()) return -1; QByteArray b; b=p->readAll(); out<<QString(b)<<endl; qDebug()<<QString(b); out<<"[end]"<<endl; qDebug()<<"debug end"; return 0; }