Maybe you are right, I only simplely copied all the header files in
libxpm

in to that folder.

Well, if you drop into the compiler's include path all kinds of
unneeded files is no wonder that you accidentally find a conflict :)
I'm building Emacs on Windows with full image support (all image types
except Postscript, which is unsupported on Windows), and my include
dir contains just this:
gif_lib.h
jconfig.h
jerror.h
jmorecfg.h
jpeglib.h
png.h
pngconf.h
simx.h
tiff.h
tiffconf.h
tiffio.h
tiffvers.h
zconf.h
zlib.h
X11\xpm.h
Juanma