Sdl_image mingw compiling issue

Hey there. I’ve got a fresh install of mingw with msys on a windows 7 x64
system.

g++.exe (GCC) 4.5.0
SDL 1.2.14
SDL_image 1.2.10

I was able to compile libz, libpng, libjpeg, libtiff, and SDL, but when I
try to compile SDL_image I get the following errors.

IMG_png.c: In function IMG_InitPNG': IMG_png.c:250: warning: assignment from incompatible pointer type IMG_png.c: In functionIMG_LoadPNG_RW’:
IMG_png.c:350: error: dereferencing pointer to incomplete type
IMG_png.c:419: error: dereferencing pointer to incomplete type
IMG_png.c:421: error: dereferencing pointer to incomplete type
IMG_png.c:429: error: dereferencing pointer to incomplete type
IMG_png.c:477: error: dereferencing pointer to incomplete type
IMG_png.c:478: error: dereferencing pointer to incomplete type
IMG_png.c:479: error: dereferencing pointer to incomplete type
IMG_png.c:480: error: dereferencing pointer to incomplete type
IMG_png.c:481: error: dereferencing pointer to incomplete type
IMG_png.c:482: error: dereferencing pointer to incomplete type
make: *** [IMG_png.lo] Error 1

I’ve run
./configure --prefix=/mingw
make

Can anyone help me out here? It’s a function pointer issue for non-dynamic
png loading, according to what I saw in IMG_png.c.

I can’t remember off the top of my head but I remember having to make a small hack to either the configure script or the generated makefile for SDL_image when using a 1.4.x version of libpng. The script, even though it finds and uses the libpng 1.4.x headers, still puts “-lpng12” in the linker options, so a manual modification to get it to be “-lpng14” did the trick.

Having just had a little closer look, I believe that the modification was required in the generated Makefile, after the configure.