1

I am trying to use SDL2_Image to load png and jpeg files. However, I have some problems getting proper dll files. Apparently the library needs those two files at runtime:

libjpeg-8.dll

libpng15-15.dll

Where is a reliable source of those two files or how can I build them myself? I am using Windows 7 and trying to make a 32-bit application.

There are many copies of those .dll files on the web, but every file I check seems to be of different size, so I consider them unreliable - at least until someone tells me this is the file...

libpng

To get this one working I checked http://www.libpng.org/pub/png/libpng.html and ended up over here: http://sourceforge.net/projects/libpng/files/. From there I downloaded the latest available version - lpng1514.7z (+ needed zlib125.zip) and managed to build it, producing libpng15.dll - which is almost what I need.

As a dirty hack I tried just renaming the file, and it seems to be working so far, but I would prefer to have a proper dll instead.

libjpeg

For jpeg I followed http://www.ijg.org/ and ended up downloading jpegsr8.zip but I get sources that I am not sure how to build under Windows (using Visual Studio).

CygnusX1
  • 20,968
  • 5
  • 65
  • 109

2 Answers2

2

gnuplot has prebuilt binaries for Windows, which has those DLLs, see http://downloads.sourceforge.net/project/gnuplot/gnuplot/4.6.0/gp460win32.zip for example.

or

Gimp for Windows installs whole bunch of DLLs including libjpeg-8.dll and libpng15-15.dll see, http://downloads.sourceforge.net/project/gimp-win/GIMP%20%2B%20GTK%2B%20%28stable%20release%29/GIMP%202.8.2/gimp-2.8.2-setup-1.exe

ismail
  • 46,010
  • 9
  • 86
  • 95
  • Thank you. It definitely helps on `jpeg` end, but it is using `png14-14` instead of `15-15`. – CygnusX1 Jan 27 '13 at 20:08
  • While it is good to obtain prebuilt binaries from somewhere, for a serious project I wouldn't rely on third parties to provide me with libraries and would make sure my build process allows me to build them when needed – emartel Jan 27 '13 at 23:25
2

libpng15.dll should be good enough, it means it's version 1.5 (the 15_15 must be release 15 of 1.5).

As for libjpeg, you could rebuild it yourself. See this question for a way to build it on Windows (it's done outside of Visual Studio) using free tools.

You could probably try to adapt the makefile to your version of visual studio, but it's probably easier to use MinGW.

I will convert one of my project to SDL2 this week, I will share my progress if you are still stuck with SDL2_Image.

EDIT As I told you, I am in the process of porting my own engine to SDL2. When building SDL_image, I noticed an external folder in the VisualC folder. The external folder contains all the DLL files used by SDL_Image:

31/01/2013  12:54 AM           200,192 libjpeg-8.dll
31/01/2013  12:54 AM           211,456 libpng15-15.dll
31/01/2013  12:54 AM           466,944 libtiff-5.dll
31/01/2013  12:54 AM           222,208 libwebp-2.dll
31/01/2013  12:54 AM             2,998 LICENSE.jpeg.txt
31/01/2013  12:54 AM             4,438 LICENSE.png.txt
31/01/2013  12:54 AM             1,294 LICENSE.tiff.txt
31/01/2013  12:54 AM             1,653 LICENSE.webp.txt
31/01/2013  12:54 AM             1,450 LICENSE.zlib.txt
31/01/2013  12:54 AM            90,624 zlib1.dll
              10 File(s)      1,203,257 bytes

So no need to build anything, just sync from the Mercurial repository located here: http://hg.libsdl.org/SDL_image/

Community
  • 1
  • 1
emartel
  • 7,712
  • 1
  • 30
  • 58
  • Thanks for the link! Please do let me know about your progress. I would like to know even if I get unstuck myself (and I am almost there thanks to your responses) – CygnusX1 Jan 27 '13 at 21:58