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?)
It seems to be a bug. There is a thread with a simple patch (in the very end).
if win32{
QMAKE_CXXFLAGS += -std=gnu++0x
}
else {
QMAKE_CXXFLAGS += -std=c++0x
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With