My third option should have worked, but it's pretty much equivalent to JLBorges'.
Regardless, there's some history to this because:
(1) Code Blocks may come with a slightly outdated compiler. I'm not sure if this is still the case, but the default compiler can easily be replaced with your own, up-to-date one -- Code Blocks as an IDE itself is still great.
(2) Outdated versions of the compiler have to set -std=c++11 as an addition command-line argument to g++ to get C++11 to work. There should be a checkbox in Compiler Settings that does this for you.
(3) Outdated versions of MinGW (Which is the GNU GCC Compiler for Windows) have a bug where std::to_string is not recognized. https://stackoverflow.com/questions/12975341/to-string-is-not-a-member-of-std-says-g-mingw