Adding a guard around the conflicting definitions such as:
#ifndef __MINGW32__
typedef uint32_t DWORD;
....
#endif
in FreeImage.h should fix the problem.
The problem here is a caused by a discrepancy between Visual Studio and MinGW in their versions of windows.h.
In Visual Studio 2005, windows.h contains the following preprocessor directives:
#ifndef _WINDOWS_
#define _WINDOWS_
In the header files distributed with the MinGW installation of Code::Blocks, the beginning of windows.h looks like this:
#ifndef _WINDOWS_H
#define _WINDOWS_H
FreeImage DOES check for a previous inclusion of windows.h to prevent redefinition, but does it using the _WINDOWS_ constant (ala Visual Studio).