I installed Codeblocks with mingw, chose default compiler, and could build and run a simple hello program without errors.
I installed Sublime Text 2, copy pasted the
First, make sure you save the file you're working on, wherever on your drive, before building and running.
Sublime Text 2 needs g++, bash, etc in order to compile. These packages need to be installed on your computer, as per the instructions on this page:
http://mjiang.com/mec/cs244/files/Installing%20c++_g++_on_Windows.pdf