It looks like Code::Blocks works correctly, but you get issues when compiling a program.
In this case it's not a C::B issue, but a setup/compiler issue abd does not really belong in this forum/website.
Try to make your compiler work on the commanline and then make sure everything is setup correctly in C::B /especially "Settings -> Compiler -> [your compiler] -> Toolchain executables".
If you know what you need, but don't know where to configure it, feel free to ask here.