asrob-uc3m / robotDevastation

A new-generation shooter with augmented reality and real robots. You can play online with other users with your PC, moving robots in championships and campaigns: all 24/7!
http://asrob-uc3m.github.io/workgroups/2017-05-28-robot-devastation.html
GNU Lesser General Public License v2.1
9 stars 4 forks source link

Recurrent issues with zlib1.dll on Windows #111

Closed PeterBowman closed 6 years ago

PeterBowman commented 6 years ago

This issue was already solved, but I want to sum it up and document its outcome. Devs might find this a suitable place when looking for an answer in case of future crashes, or use this page to describe any follow-up actions taken.

To make this easier to discover through a GH search, I'm copy-pasting the most notable error message:

[error] SDLScreenManager.cpp:159 rd::SDLScreenManager::initSDL(): SDL_image could not initialize! SDL_image Error: Failed loading libpng16-16.dll: The specified procedure could not be found.

On-screen prompts will additionally mention a missing entry point and a function name. Indirectly, all of this boils down to problems with zlib1.dll, which is a basic dependency for:

You'll find a copy of this DLL when downloading the binaries of each package listed above. It's known to introduce version mismatches on runtime:

Symptoms of the above have been pictured in the error message incidentally pointing at libpng16-16.dll, but the main friction point here is clearly the zlib1.dll thing. It's vital to proceed with care while configuring the search paths for DLLs AND when moving the binaries around:

I discovered that the system PATH may spoil any improvements on the user PATH since it's evaluated in the first place. I ran into this because there was another zlib1.dll in MinGW/bin, which in turn was set by the system itself and could not be modified through the Control Panel. You'd have to resort to manually tweaking the PATH via command-line (always prepend new values instead of appending them).

Another option is to copy that DLL to the corresponding working directory (usually the same as where the game executables are located at). Ongoing work on CPack will take this into account and bundle all necessary binaries with the game files.

Dependency Walker is the recommended tool for debugging these issues. Refer to comments at #95 for further background.

PeterBowman commented 6 years ago

Also ran into this issue with libiconv-2.dll: 421549d.