简体   繁体   中英

How to fix “SDL_image could not initialize!”?

I'm following a tutorial on how to do SDL2 programming in C++. I'm on windows. My computer is 64 bit. I'm using 32 bit libraries for compatibility reasons and because I'm following a tutorial [which has instructed to use 32 bit versions].

I tried to call the SDL image library with my compiler, and got the following error:

"SDL_image could not initialize! SDL_image Error: Failed loading libpng16-16.dll: The specified procedure could not be found"

(I put all of the Dlls I could find into MySysWow64 I've never been good at linking up compilers so I probably did that wrong [I'm using codeblocks])

It also produces the following pop-up:

"SDL Tutorial: SDL2_TEST1.exe - Entry Point Not Found

The procedure entry point inflateValidate could not be located in the dynamic link library C:\\windows\\SYSTEM32\\libpng16-16.dll"

The tutorial instructed me to place the DLLs for SDL image into the MySysWow64 directory; I thought I did that. What could be causing this and how I can I troubleshoot in order to fix it?

PS: I'm using windows10, not sure if that's relevant, but since it may be, this is why I included it; I assumed that was a good idea, if not, I am totally flexible on this. I wanna ask only the best questions

Hit the same error with SDL after unpacking zlib1.dll (version 1.2.8) from SDL2_ttf-devel-2.0.14 to my compiler's bin folder, much like unpacking to your MySysWow64 folder which I'd be much less inclined to do. Searching the error "The procedure entry point inflateValidate" will pull up lots of zlib1.dll conflict results. The zlib1.dll (1.2.11) from SDL2_image-devel-2.0.4 worked where the 1.2.8 version generated the error you report. Delete zlib1.dll and find a newer version, also consider that there may be another conflicting zlib1.dll already in your PATH somewhere else which is causing the error, check your PATH for other copies of the DLL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM