I’m building an SDL application in Go using a sample repository to reproduce the problem. (full repro instructions here)
So I’m trying to build from Windows Subsystem for Linux to create a Windows build (using the bash script in the example). It works for SDL2_image version 2.0.1 but not newer versions. On newer versions, it fails with the following message:
Failed to load PNG: Failed loading libpng16-16.dll: The specified procedure could not be found.
I’m not sure how to debug from here, but the only thing I change to go from failure to working is changing the SDL2_image version. Any help would be appreciated!
You’ll need to download that DLL, and place it in the same directory as your executable to get it to work. Are you running that from a Windows machine and getting that error, or when you’re compiling?
The fatal error occurs when attempting to load a png image using SDL2_image. The line printing the error message is here, immediately after a call to img.Load, which I believe corresponds to IMG_Load() declared in SDL_image.h.
I have discovered that the crash doesn’t happen if I build using version 2.0.3 and replace the libpng with the libpng provided in 2.0.1. Therefore I have decided to submit a bug.