Whenever I try to load a PNG using SDL_Image's IMG_Load function it gives the error Failed loading libpng16-16.dll:
. I have all the right dll's in the right path and I can use other parts of SDL_Image, but for some reason it can't load the libpng dll. How can I fix this? Any help is appreciated.
It appears that libpng16-16.dll
has a dependency on zlib1.dll
for MinGW-w64 (32-bit). Try to include zlib into your dependnecies--include the DLL in the folder where the executable runs.
Very niche answer, but for those running into this issue because of pySDL2, it could be caused because your python interpreter is sub-par. For me, using the windows store install for python interpreter 3.10, gave this issue. However, when I switched to 3.10 from python.org all my issues were fixed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With