Hallo,
ich bin gerade dabei, mit gcc und Qt 4.5.1 (2009.04) etwas auf die Konsole auszugeben.
Hier ein kleines Beispiel (gekürzt aus Molkenthin/extractessentials):
#include <QtCore>
#include <iostream>
#include <stdio.h>
using namespace std;
int main(int argc, char* argv[])
{
if (argc < 2) {
cout << "Usage: " << argv[0] << " infile [outfile]" << endl;
return 1;
}
QFile in(argv[1]);
if(!in.open(QIODevice::ReadOnly|QIODevice::Text)) {
cerr << "File " << argv[1] << " does not exist" << endl;
}
// ...
}
qmake -project
qmake -makefile
make
Weder unter Windows noch unter Linux bekomme ich irgendeine Ausgabe.
Selbst wenn ich im Makefile explizit -mconsole angebe, erfolgt keine Ausgabe.
Auch mit qDebug() kommt nichts. Als Netbeans 6.7.1-Projekt kompiliert passiert natürlich auch nichts.
Mit früheren Qt-Versionen habe ich solche Ausgaben problemlos erhalten.
Hat jemand dazu eine Idee?