PDA

View Full Version : No console output in Mac OSX using Qt4



popoholic
25th September 2006, 21:34
Hi!

I'm working with a GLC Viewer application (GLC Viewer is based on Qt4, you can read more about it here: http://glc-lib.sourceforge.net/). When I try to do couts, nothing is showing in the terminal. I wrote a small test application which I compiled using qmake, but it didn't work. I modified the inital pro file with an extra line CONFIG += console and then recompiled, but it still didn't work. This is the code:

test.cpp

#include <iostream>
#include <stdlib.h>
#include <sstream>

int main(int, const char**) {
std::cout << "Hi!" << std::endl;
return 0;
}

test.pro (edited, with the config line added)

TEMPLATE =
TARGET +=
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += console

# Input
SOURCES += test.cpp

What's going on? Cout works on my computer in common C++ applications, so why doesn't it work in Qt applications?

I'll be very grateful for any help.

jacek
25th September 2006, 22:56
http://www.qtcentre.org/forum/f-qt-programming-2/t-config-console-for-mac-3426.html

popoholic
26th September 2006, 02:36
Thank you! =)