I think the GCC version doesn't support the openmp directives. It would be better if someone suggest me to which version of GCC compatible with OpenMp commends to use with Code::Blocks
try TDM-GCC, which can be downloaded from:TDM's GCC/mingw32 Builds (http://www.tdragon.net/recentgcc/)
And read it's manual about how to use Openmp.
By the way, your question is not related to Codeblocks. :D