errors in basic_string.h with compiler setting -std=c++0x

Using Code::Blocks as IDE and GNU GCC Compiler, when I use the compiler setting
"Have g++ follow the coming C++0x ISO C++ language standard [-std=c++0x]" when I compile any program with '#include <iostream>' the compiler indicates 8 incomprehensible errors in basic_string.h which causes compilation to fail. When I deactivate that compiler setting, the compiler does not indicate these errors but produces a warning about using syntax "only available with -std=c++0x", which does not prevent compilation. I am wondering if anyone knows why the -std=c++0x setting causes errors in basic_string.h.
Show code which causes an error.
And you should use -std=c++11 now.
I am looking in the Code::Blocks compiler settings and cannot find -std=c++11 as an option.
The code that causes the error is '#include <iostream>' which includes basic_string.h where the compiler indicates the error.
The errors are as follows:

||=== Build: Debug in Rational (compiler: GNU GCC Compiler) ===|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.h|3010|error: 'u16string' was not declared in this scope|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.h|3010|error: template argument 1 is invalid|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.h|3011|error: 'u16string' was not declared in this scope|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.h|3011|error: template argument 2 is invalid|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.h|3021|error: 'u32string' was not declared in this scope|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.h|3021|error: template argument 1 is invalid|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.h|3022|error: 'u32string' was not declared in this scope|
c:\mingw\bin\..\lib\gcc\mingw32\4.6.2\include\c++\bits\basic_string.h|3022|error: template argument 2 is invalid|

||=== Build failed: 8 error(s), 8 warning(s) (0 minute(s), 0 second(s)) ===|

Update your compiler. And IDE too: newer versions have c++11 checkbox. And you can always add it manually.
Right now I cannot find out what version of g++ or 'GNU GCC compiler' I have installed on my computer and connected with my IDE's (JGrasp and Code::Blocks). I installed the GCC version 4.8.1 on my computer yesterday, but how do I tell my IDE's to use the new version instead of the old one?

It is on Code::Blocks 13.12 where I cannot find -std=c++11 as an option.

Now having written part of another program in JGrasp, I am seeing another C++11 nonrecognition error: "'nullptr' was not declared in this scope". I have compiled this both with -std=c++11 and with -std=c++0x compiler settings and this error prevents compilation.
> how do I tell my IDE's to use the new version instead of the old one?

Menu => Settings => Compiler => Global Compiler Settings => Toolchain Executables
Topic archived. No new replies allowed.