Hi all,
I have installed Qt 5.0.1 with QtCreator 2.6.2 on Windows 7 and experience a strange behaviour. When I start a new plain C project, everything works fine (the standard Hello World is printed to the console). However when I start a new plain C++ project, again the Hello World is printed to the console but a new (native Microsoft) window pops up and tells me that myprogramname.exe doesn't work anymore . And what I really don't get is the fact that if I delete the part "<< endl" everythings run without problems!
It seems like Qt is having trouble with endl. When I hover endl with my cursor, it says something like "QTextStream & endl...", whereas hovering cout results in "std::cout". Is this perhaps my problem? Can you replicate my problem on your PC? What can I do to fix this problem?
main.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
To copy to clipboard, switch view to plain text mode
myprogramname.pro
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
To copy to clipboard, switch view to plain text mode
Bookmarks