PDA

View Full Version : Print with iostream to console



afflictedd2
17th March 2009, 16:05
Hi everyone,

I was wondering if it is possible to print output to the command line while running a gui, I have tried using iostream... cout << .. but it doesn't work. Is there something specific I have to do in the main that starts the application.. this is what it looks like:


#include <QApplication>
#include "mainwindow.h"

int main (int argc, char *argv[])
{
QApplication app( argc, argv );
MainWindow main;
main.show();
return app.exec();
}

aamer4yu
17th March 2009, 17:03
You will need to add
CONFIG += console to your .pro file