Thanks for your comments. I uninstalled C::B, installed MiniGW in c:\MiniGW (the default), then reinstalled C::B without MiniGW. Tried to compiled Hello World c++ again, and it failed with the same problem as before.
Ok, I finally figured out the problem. I had to go into the toolchain executables window and reset the compiler and linker to both use g++.exe instead of the default g++.exe.lnk.