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;
}
#include <iostream>
#include <stdlib.h>
#include <sstream>
int main(int, const char**) {
std::cout << "Hi!" << std::endl;
return 0;
}
To copy to clipboard, switch view to plain text mode
test.pro (edited, with the config line added)
TEMPLATE =
TARGET +=
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += console
# Input
SOURCES += test.cpp
TEMPLATE =
TARGET +=
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += console
# Input
SOURCES += test.cpp
To copy to clipboard, switch view to plain text mode
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.
Bookmarks