Please don't post only C++ related things here. This is the SFML forum and not an C++ forum.
They've already posted everything you have to do: Don't use the original MinGW version, instead get for example "MinGW Builds".
When you do so, you need to reconfigure the compiler in Code::Blocks and make sure you don't have multiple MinGW version in PATH.
And at the end don't forget to add the flag for C++11.