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 4198 - Failure loading libpng for 2.0.2+ when building with mingw32
Summary: Failure loading libpng for 2.0.2+ when building with mingw32
Status: ASSIGNED
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: 2.0.2
Hardware: x86_64 Windows 10
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-13 19:36 UTC by Adam
Modified: 2019-06-10 23:54 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 Adam 2018-06-13 19:36:52 UTC
Overview:

I'm building an SDL application in Go using a sample repository (https://github.com/adam000/go-sdl2-wsl-build-windows) to reproduce the problem. (full repro instructions at https://github.com/veandco/go-sdl2/issues/336 )

I'm building from Windows Subsystem for Linux to create a Windows build (using the bash script in the example). It works for SDL_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 *can* get newer versions to work simply by replacing the libpng DLL with the one bundled in SDL_image 2.0.1. I noticed that libpng was upgraded after 2.0.1 and before 2.0.2 (revision 518).

Steps to reproduce:

1. On WSL, run `./make-win64-on-wsl.bash` from repository root, optionally providing a destination like `/mnt/c/Users/myuser/Desktop`.
2. Under Windows command line, navigate to the destination and run build.exe

Actual results:

Application crashes with:

> Failed to load PNG: Failed loading libpng16-16.dll: The specified procedure could not be found.

Expected Results:

A png of a drawing of a gopher should appear on the screen for several seconds, then disappear.

Additional information:

Related forum post: https://discourse.libsdl.org/t/sdl2-image-fails-loading-libpng-on-latest-versions-when-cross-compiling/24494