I followed the instruction here on setting up CodeBlocks to use GCC 4.7.1 .the sample provided at the page i mentioned is compiled just fine,But when i tried to compile the
Try MinGw builds:
http://sourceforge.net/projects/mingwbuilds/
This installer will allow you to choose whatever MinGW you want and also includes c++11 thread functionality.
c++11