To apply a patch to SDL_ttf, I tried to build SDL from sources. SDL2_image-2.0.5 seems not to work properly because of libpng compatibility. Compiling worked fine, but the program failed displaying this message during runtime:
libpng warning: Application built with libpng-1.2.54 but running with 1.6.34
Couldn't allocate memory for PNG file or incompatible PNG dll
I tried ./showimage heli.png and it failed too with the same kind of message:
libpng warning: Application built with libpng-1.2.54 but running with 1.6.34
INFO: Couldn't load heli.png: Couldn't allocate memory for PNG file or incompatible PNG dll
I’m using ubuntu 18.04, both libpng12-0 and libpng16-16 seem to be installed.
How could I build SDL2_image with libpng 1.6 or execute showimage with libpng 1.2 ?
Or maybe there is another way to solve this problem ?
It’s hard to remove libpng12-0 because libsdl1.2 is installed and is used by many applications like VLC, and removing it will remove them. I tried it weeks ago and was very surprised to see all these applications disappeared, because I didn’t read well enough what was written by own screen !
Finally, I just removed libsdl1.2-dev that was here from years ago, ./configure and make the lib again and got the same result:
libpng warning: Application built with libpng-1.2.54 but running with 1.6.34
INFO: Couldn’t load heli1_1.png: Couldn’t allocate memory for PNG file or incompatible PNG dll
You’re perfectly right to advise me to do that: here the last line from compilation from the linker:
I think ./configure creates makefiles with the wrong png library when both libraries are installed. So I manually change libpng12 to libpng16 in the generated makefile. I was surprised to see one libpng16 (line 297) and many libpng12 in it. make clean and make still gives the same error message.