You have failed to specify which version of Code::Blocks you're using, as well as which version of Windows.
In any case, this is a classic symptom of trying to run MinGW/GCC on Windows Vista. If you're running Vista, you can find other threads in the C::B forums on how people were able to resolve this issue.