I see in your messages c:/program: error ....
This suggest me that one of the mingw tools used still consider a blank space as a string separator. So the full name c:/program files/... is not accessible, because the real full name is truncated.
Try to install your compiler in a path without any space in its full name.
I know that the standard mingw compiler installed with C::B installs the compiler within a sub folder of "program files/codeblocks". Generally, it works, but for some tools, it apparently still has problems. A solution : download the tdm compiler and install it directly in c:\Mingw32 (or c:\MinGW64) and rebuild the compiler and link path in your C::B configuration.
May be you can also try a simple copy (or move) of the mingw subfolder of codeblocks (and always update the path cofiguration).
gd_on