Trying to build SDL2_Image, help needed


Burbruee

Member
Joined
Sep 28, 2006
Messages
302
Location
Skåne, Sweden.
Website
Visit site
Hey,

I'm trying to port a game over to the pandora, it uses SDL2.

I've managed to build SDL2 for our device with no issues, tried a simple hello world with some colored rects and it runs.

I need the following extra libs for the game: sdl2_image, sdl2_ttf, sdl2_mixer

sdl2_ttf and sdl2_mixer built without issues, however sdl2_image seems to be having some problems.

I'm building straight on the device to /mnt/utmp/codeblocks/usr/




 
/bin/bash ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -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 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL2_image\" -DVERSION=\"2.0.0\" -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.so.5\" -DLOAD_JPG_DYNAMIC=\"libjpeg.so.8\" -DLOAD_PNG_DYNAMIC=\"libpng14.so.14\" -I. -I/mnt/utmp/codeblocks/usr/include/libpng14 -g -O2 -D_REENTRANT -I/mnt/utmp/codeblocks/usr/include/SDL2 -MT IMG_png.lo -MD -MP -MF .deps/IMG_png.Tpo -c -o IMG_png.lo IMG_png.c

libtool: compile: gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -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 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"SDL2_image\" -DVERSION=\"2.0.0\" -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.so.5\" -DLOAD_JPG_DYNAMIC=\"libjpeg.so.8\" -DLOAD_PNG_DYNAMIC=\"libpng14.so.14\" -I. -I/mnt/utmp/codeblocks/usr/include/libpng14 -g -O2 -D_REENTRANT -I/mnt/utmp/codeblocks/usr/include/SDL2 -MT IMG_png.lo -MD -MP -MF .deps/IMG_png.Tpo -c IMG_png.c -fPIC -DPIC -o .libs/IMG_png.o

IMG_png.c:102:25: error: unknown type name 'png_const_bytep'

IMG_png.c: In function 'IMG_InitPNG':

IMG_png.c:235:12: error: 'struct <anonymous>' has no member named 'png_sig_cmp'

IMG_png.c:236:23: error: unknown type name 'png_const_bytep'

IMG_png.c:237:13: error: expected ';' before 'SDL_LoadFunction'

IMG_png.c:238:17: error: 'struct <anonymous>' has no member named 'png_sig_cmp'

In file included from IMG_png.c:595:0:

IMG_png.c: At top level:

miniz.h:2436:28: warning: always_inline function might not be inlinable [-Wattributes]

miniz.h:2428:28: warning: always_inline function might not be inlinable [-Wattributes]

miniz.h:2260:28: warning: always_inline function might not be inlinable [-Wattributes]

make: *** [IMG_png.lo] Error 1
I'm not sure, but I think the errors are libpng-related?

Did anyone try this before? Got some tips on how I can build it? Let me know! :)
 
There will be (soon) a new code::blocks PND, with SDL2_image, SDL2_ttf and SDL2_mixer (it will be very huge, something like 1,5 Go!!!).

The problem you have is some some libpng mixing. libpng12 and libpng14 are not compatible, it want to use libpng14, but is probably geting libpng12 header instead.
 
There will be (soon) a new code::blocks PND, with SDL2_image, SDL2_ttf and SDL2_mixer (it will be very huge, something like 1,5 Go!!!).

The problem you have is some some libpng mixing. libpng12 and libpng14 are not compatible, it want to use libpng14, but is probably geting libpng12 header instead.
Cool, that would be great. Any ETA on when it will be ready?

Until it's released, is there a way I can point it to the correct headers?
 
In order to build SDL2_image, I had to edit IMG_png.c and change:

/* Check for the older version of libpng */
#if (PNG_LIBPNG_VER_MAJOR == 1)
#if (PNG_LIBPNG_VER_MINOR < 4)

...to:

/* Check for the older version of libpng */
#if (PNG_LIBPNG_VER_MAJOR == 1)
#if (PNG_LIBPNG_VER_MINOR < 5)

...since my (and your) installed 1.4.x version doesn't have "png_const_bytep" defined.  It's probably not a very "correct" fix, but it got me running.  Hope this helps!
 
Back
Top