Hmm, it sounds as if you didn't link the Include folder from the SDK correctly. Or at all.
Under CodeBlocks's settings, compiler and debugger settings. The linker settings and Search Directories tabs are of interest.
The linker needs to have kernel32 ,user32, gdi32 and advapi32linked (op2extra.lib as well, if you use IUnit)
The Directories Tab's Compiler Tab needs to have both the compiler's include folder, as well as the SDK Include folder (if kept separate, you can always throw the contents of the OP2 SDK Include folder into the compiler's Include folder).
The same applies to the Linker Tab, only with Lib folders.
This is, at least, how I have it set up (using VC++ 2003).