We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1127

Summary: Building with libpng 1.5 doesn't work
Product: SDL_image Reporter: Mikael Eriksson <mikael_eriksson>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 1.2.10   
Hardware: All   
OS: All   
Attachments: libpng 1.5 support

Description Mikael Eriksson 2011-02-16 16:09:28 UTC
Trying to build SDL_image with libpng 1.5 fails with:

/bin/sh ./libtool --tag=CC   --mode=compile i486-mingw32-gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL_image\" -DVERSION=\"1.2.10\" -DLOAD_JPG=1 -DLOAD_PNG=1 -DLOAD_TIF=1 -DLOAD_BMP=1 -DLOAD_GIF=1 -DLOAD_LBM=1 -DLOAD_PCX=1 -DLOAD_PNM=1 -DLOAD_TGA=1 -DLOAD_XCF=1 -DLOAD_XPM=1 -DLOAD_XV=1 -DLOAD_TIF_DYNAMIC=\"libtiff-3.dll\" -DLOAD_PNG_DYNAMIC=\"libpng15-15.dll\" -I.     -I/usr/i486-mingw32/include/libpng15   -g -O2 -D_GNU_SOURCE=1 -Dmain=SDL_main -I/usr/i486-mingw32/include/SDL   -MT IMG_png.lo -MD -MP -MF .deps/IMG_png.Tpo -c -o IMG_png.lo IMG_png.c
libtool: compile:  i486-mingw32-gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL_image\" -DVERSION=\"1.2.10\" -DLOAD_JPG=1 -DLOAD_PNG=1 -DLOAD_TIF=1 -DLOAD_BMP=1 -DLOAD_GIF=1 -DLOAD_LBM=1 -DLOAD_PCX=1 -DLOAD_PNM=1 -DLOAD_TGA=1 -DLOAD_XCF=1 -DLOAD_XPM=1 -DLOAD_XV=1 -DLOAD_TIF_DYNAMIC=\"libtiff-3.dll\" -DLOAD_PNG_DYNAMIC=\"libpng15-15.dll\" -I. -I/usr/i486-mingw32/include/libpng15 -g -O2 -D_GNU_SOURCE=1 -Dmain=SDL_main -I/usr/i486-mingw32/include/SDL -MT IMG_png.lo -MD -MP -MF .deps/IMG_png.Tpo -c IMG_png.c  -DDLL_EXPORT -DPIC -o .libs/IMG_png.o
IMG_png.c: In function 'IMG_LoadPNG_RW':
IMG_png.c:350:7: error: dereferencing pointer to incomplete type
IMG_png.c:419:21: error: dereferencing pointer to incomplete type
IMG_png.c:421:28: error: dereferencing pointer to incomplete type
IMG_png.c:429:22: error: dereferencing pointer to incomplete type
IMG_png.c:477:25: error: dereferencing pointer to incomplete type
IMG_png.c:478:30: error: dereferencing pointer to incomplete type
IMG_png.c:479:23: error: dereferencing pointer to incomplete type
IMG_png.c:480:38: error: dereferencing pointer to incomplete type
IMG_png.c:481:38: error: dereferencing pointer to incomplete type
IMG_png.c:482:38: error: dereferencing pointer to incomplete type
make: *** [IMG_png.lo] Error 1
Comment 1 Mikael Eriksson 2011-02-16 16:11:05 UTC
Created attachment 575 [details]
libpng 1.5 support

The attached patch makes it build with libpng 1.5. I have also verified that it still works with libpng 1.4.
Comment 2 Sam Lantinga 2011-02-16 16:26:09 UTC
Have you tried SDL_image from Mercurial?
hg clone http://hg.libsdl.org/SDL_image
Comment 3 Mikael Eriksson 2011-02-16 16:46:26 UTC
The hg tip compiles fine. Guess I should have checked that before writing the patch.
Comment 4 Sam Lantinga 2011-02-16 17:18:40 UTC
Okay, thanks!