Try mingw (
http://www.mingw.org/), you can still get the latest 32-bit version to run on windows XP (I think). It is as up to date as you can get.
When you compile, it defaults to C++98, I guess this is because of the perception that most people are still using this. To compile successfully you need to use the std flag; for a flag hello .cpp try any of the following in order of how recent the features you need are:
g++ -o hello hello.cpp -> c++98 only
g++ -std=c++11 - o hello hello.cpp -|
g++ -std=c++1x - o hello hello.cpp -|-> support c++11
g++ -std=c++1y - o hello hello.cpp -|
That could be responsible for your errors, but I can't say without seeing the actual errors. I'm not a windows type, but doesnt visualstudio use something like _tmain(int TCHAR**) instead of main(int, char**)?
Also, it uses precompiled headers, and may automatically include other headers you need, even add a "using namespace std" for you, so make sure you manually include all the headers you need, and be aware of the namespace issue.
P.S. I don't use codeblocks, but I'd expect it to have an option of either selecting your c++ dialog, or adding the necessary compile flags to the build command.