SDL/Pygame failing to load PNG images with cx_Freeze

Posted by jjackson on Stack Overflow See other posts from Stack Overflow or by jjackson
Published on 2010-05-21T15:06:09Z Indexed on 2010/05/21 15:10 UTC
Read the original article Hit count: 207

Filed under:
|
|
|

I'm running Python 3.1 on Windows and I'm trying to distribute my Pygame script as an executable via cx_Freeze. Right now it seems to be working except that the exe build can't load any of my images:

Cannot load image: C:\path\to\build\exe.win32-3.1\resources\image.png
File is not a Windows BMP file

Googling has revealed that this happens when the SDL imaging library doesn't get included correctly. However, SDL_image.dll and libpng12-0.dll are both put by cx_Freeze into my build directory, so it seems to me like everything should be fine. Why wouldn't it be able to load PNG images?

© Stack Overflow or respective owner

Related posts about python

Related posts about pygame