I\'m trying to use new C++0x features in Qt Creator under Windows (Qt Creator 2.0.1).
I read the thread Configuring the GCC compiler switches in Qt, Qt Creator, and Q
First off, it could be that the library headers just don't represent their dependencies properly. Try adding an #include
and perhaps (unfortunately) a using namespace std;
to your file at the top.
Failing that, several people seem to have had issues with MinGW and swprintf. This mailing list post suggests adding this:
#ifdef WIN32
#define swprintf _snwprintf
#endif
See if that resolves the issue. (You want it at the very top of the file, too.)
If prepending random defines to your source seems like a bad idea to you, I suggest using -D
build flags to conditionally inject the above define when you're building on MinGW.
See also this short discussion on the differences between swprintf on MinGW vs. other compilers.
Finally, failing all else, this link seems to attribute the problem to an issue with flags that enable __STRICT_ANSI__
in MinGW, and suggests commenting out a couple of lines in one of the MinGW headers to fix the issue. I would suggest adding a simpler #ifndef __STRICT_ANSI__
around them instead if you decide to go with this hack.