4

If I specify -std=c++0x to g++, then I can't #include <iostream>. I get the following error messages (g++ 4.4.0 under mingw):

In file included from c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/postypes.h:42,
                 from c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/iosfwd:42,
                 from c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/ios:39,
                 from c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/ostream:40,
                 from c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/iostream:40,
                 from f.cpp:1:
c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:159: error: '::swprintf' has not been declared
c:\qt\2010.05\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:166: error: '::vswprintf' has not been declared

Any ideas why? Has this been fixed in the latest g++? (And if so, does anybody know how to incorporate the latest g++ into Qt?)

TonyK
  • 16,761
  • 4
  • 37
  • 72

2 Answers2

7

It seems to be a bug. There is a thread with a simple patch (in the very end).

ssmir
  • 1,522
  • 8
  • 10
3
if win32{
    QMAKE_CXXFLAGS += -std=gnu++0x
}
else {
    QMAKE_CXXFLAGS += -std=c++0x
}
ceving
  • 21,900
  • 13
  • 104
  • 178
dbfbf
  • 31
  • 1