This seems to just have happened to me today. yesterday everything worked fine then late at night i updated msys2 packages. then today it no longer will run within msys2 and displays the following error.
http://i.imgur.com/zZMESMO.png
(4:33:51 PM) DavidEGrayson: Looking at http://repo.msys2.org/mingw/i686/ , we can see that libpng has not been rebuilt after zlib was updated. I suspect libpng was configured and built against an older version of zlib and that this causes some mismatch.
(4:33:52 PM) m2bot: Title: Index of /mingw/i686/ (at repo.msys2.org)
(4:35:34 PM) DavidEGrayson: I would make a minimal example to demonstrate the problem and report it as an issue to https://github.com/Alexpux/MINGW-packages Then someone can try rebuilding libpng and see if that fixes the problem.
By "minimal example", I meant a 10 to 20 line C program, along with the command used to compile it, that one could use to reproduce the problem. Or if you could just point to some other packaged MSYS2 executable that cannot run because of this problem that would work. It helps if other people can reproduce the problem on their own machine.
Hello, I have the same problem with msys2 freshly installed and updated. I can provide sample.
Same problem here, fresh install of MSYS, libpng fails with the error given by OP. I'm using libpng from cairosvg, so this is a blocking issue for a lot of software on top of libpng. I would really appreciate this being solved, as cairo is pointing to msys as the reference for win runtimes. Thank you for your cooperation.
Like @DavidEGrayson said we need to know the way to reproduce issue or it will be ignored, e.g. for me optipng and pngcrush are fine. Since I cannot reproduce it with the software I use I'm not able to help you.
Closing. But if someone comes up with some steps to reproduce the issue, please post them and we'll try to fix it.
I found my high resolution screen has this problem, but other has no problem.
That's pretty hard to believe, but if you can say exactly what steps you took to reproduce the issue then someone might be able to fix it.
I write a very simple program of opencv, then build it. In my laptop with high resolution(3840x2160) screen, I can run it in MinGW64 Shell, but I can't run it by double click it or in CMD/Powershell. If I double click it, it show that "libpng16-16.dll throwing entry point inflateReset2 could not be located". I had added MinGW64/bin into my laptop's SYSTEM PATH. But I can run it by double click it on my other computers which has low resolution(1920x1080) screen. So I guess resolution maybe cause this problem. I hope sir will help me solve this problem. Thank you very much.
It not uncommon for software targeting UNIX to cause problems on Windows with HiDPI screen.
All I can think of is bug in library exposed only in specific scenarios (like HiDPI screen).
Still the is no minimal example or logs.
Strace could bring here some useful info.
@echizenryoma There might be something else containing zlib1.dll in your path. Copy your program, libpng16-16.dll and zlib1.dll to empty directory and try to run it.
So i found the cause. Intel brings in their own zlib1.dll in C:\Program Files\Intel\WiFi\bin\ and they add this directory to PATH. So whenever an app linked against zlib tries to execute without C:\msys64\mingw64\bin in PATH, it tries to load this different version of zlib, that doesn't contain the method. The real solution would be to poke into Intel and tell them to stop doing stupid things like plaguing system-wide PATH with their own things, but whatever. Just copy your mingw64 zlib1.dll into your app directory and call it a day.
Most helpful comment
So i found the cause. Intel brings in their own
zlib1.dllinC:\Program Files\Intel\WiFi\bin\and they add this directory to PATH. So whenever an app linked against zlib tries to execute withoutC:\msys64\mingw64\binin PATH, it tries to load this different version of zlib, that doesn't contain the method. The real solution would be to poke into Intel and tell them to stop doing stupid things like plaguing system-wide PATH with their own things, but whatever. Just copy your mingw64 zlib1.dll into your app directory and call it a day.