I'm using the default settings as well. I didn't touch anything. I still think that this is because I use the 3.4.5 version of the gcc compiler while the prepackaged Codeblocks comes with version 3.4.2 of the gcc compiler.
Optimization makes the generated code run faster. The more aggressive it is the more effective the code can become. However applying too much optimization can lead sometimes to code instability. The default UFO: AI Codeblocks project adds an option to the compiler telling it to use third level optimization, which should be safe, unless the compiler is buggy. This is why I started to suspect the compiler.
As for other IDE-s, I have Eclipse with sun JDK and Visual Studio 8 installed but I don't think they could cause the problem. When I tried to compile UFO: AI with the 3.4.2 version of the compiler the linker couldn't find some libraries. As soon as I replaced it with the 3.4.5 compiler it started to work.
Since Muton seems to have the same problem as I have, I'm quite curious as to what gcc version he is using. If it is 3.4.5...
Edit:
This is probably a very *long* shot, but do you compile with the target "win32" or "win32_debug"?
Argh... You are right! I don't know when or how but looks like I somehow accidentally changed the target to windows from windows_debug. But I still don't understand why that causes a problem.