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 330 - SDL_image won't load PNGs in Windows XP
Summary: SDL_image won't load PNGs in Windows XP
Status: RESOLVED WORKSFORME
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: x86 Windows (XP)
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-21 15:27 UTC by Donald Straney
Modified: 2011-12-31 09:32 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Donald Straney 2006-09-21 15:27:48 UTC
I'm writing a program that's linked to SDL 1.2.9 and SDL_image 1.2.5 in Windows XP, and when I use IMG_Load to try to load PNG images, it returns NULL, and IMG_GetError returns "Unsupported image format".  SDL.dll, SDL_image.dll, and libpng12.dll are all in the same directory as the program, and it works fine when loading BMPs (or when it's run in Windows ME, for some reason).  If it matters, I'm using Dev-C++, which uses MinGW as a backend.
Comment 1 Dmitry Yakimov 2006-09-25 13:33:00 UTC
Hi,

Please try SDL_Image from SVN, I have fixed similar error in 2004 (http://www.libsdl.org/cgi/viewvc.cgi/trunk/SDL_image/IMG_png.c?view=log)


-- Dmitry Yakimov
Comment 2 Donald Straney 2006-09-28 16:44:52 UTC
Thanks, but when I try to compile in Dev-C++ I get these errors:

[Linker error] undefined reference to `SDL_RWFromFile'
[Linker error] undefined reference to `SDL_SetError'

I've got the SDL 1.2.9 development libraries installed, and the extra commands passed to the compiler are "-lmingw32 -lSDLmain -lSDL".  (I tried searching to see if there was something I was doing wrong, but couldn't find anything)
Comment 3 Ryan McCann 2007-09-19 19:43:00 UTC
With Dev-C++ you have to create a .a lib file for any dll's you want to call directly(Dev will occasionally let you get away without them, but the functionality involved is incredibly buggy). Anything using sdl_image needs a -lsdl_image flag. 

To get a .a file from a dll DL the mingw_utils_0.3 package, use bin/pexports.exe to change the get a .def and bin/dlltool.exe to get a .a from the .def

This is a compiler issue and not a SDL_Image issue. The current version of image(and at least two previous releases) work with PNG files on winXP.
Comment 4 BJ 2009-01-01 12:26:48 UTC
Same problem under linux. When trying to load a png file i get a segmentation fault. 

using netbeans 6.5, ubuntu 8.10, gcc, sdl 1.2.13
Comment 5 Sam Lantinga 2009-10-17 12:47:41 UTC
Can you test with the latest pre-release snapshot?
http://www.libsdl.org/tmp/SDL_image-1.2.8.zip

Thanks!
Comment 6 Sam Lantinga 2011-12-31 09:32:03 UTC
No response in a few years. :)