Download Code::Blocks and install it ( http://www.codeblocks.org/) Launch Code::Blocks and go to the Setting --> Compiler and debugger menu Create a new compiler ...
I had to modify the code slightly to compile using code::blocks with the mingw compiler.