简体   繁体   English

如何修复“ SDL_image无法初始化!”?

[英]How to fix “SDL_image could not initialize!”?

I'm following a tutorial on how to do SDL2 programming in C++. 我正在跟踪有关如何使用C ++进行SDL2编程的教程。 I'm on windows. 我在窗户上。 My computer is 64 bit. 我的电脑是64位。 I'm using 32 bit libraries for compatibility reasons and because I'm following a tutorial [which has instructed to use 32 bit versions]. 出于兼容性原因,我正在使用32位库,因为我正在遵循一个教程[已指示使用32位版本]。

I tried to call the SDL image library with my compiler, and got the following error: 我尝试使用编译器调用SDL图像库,并收到以下错误:

"SDL_image could not initialize! SDL_image Error: Failed loading libpng16-16.dll: The specified procedure could not be found" “ SDL_image无法初始化!SDL_image错误:加载libpng16-16.dll失败:找不到指定的过程”

(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]) (我把我能找到的所有Dll都放到MySysWow64中,我从来都不擅长链接编译器,所以我可能做错了[我正在使用代码块])

It also produces the following pop-up: 它还会产生以下弹出窗口:

"SDL Tutorial: SDL2_TEST1.exe - Entry Point Not Found “ SDL教程:SDL2_TEST1.exe-找不到入口点

The procedure entry point inflateValidate could not be located in the dynamic link library C:\\windows\\SYSTEM32\\libpng16-16.dll" 过程入口点inflateValidate不能位于动态链接库C:\\ windows \\ SYSTEM32 \\ libpng16-16.dll中”

The tutorial instructed me to place the DLLs for SDL image into the MySysWow64 directory; 本教程指示我将SDL映像的DLL放入MySysWow64目录中。 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; PS:我使用的是Windows10,不确定是否相关,但是因为可能是这样,所以才包含它。 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. 将zlib1.dll(版本1.2.8)从SDL2_ttf-devel-2.0.14解压缩到我的编译器的bin文件夹后,与SDL遇到相同的错误,就像解压缩到MySysWow64文件夹中一样,我不太愿意这样做。 Searching the error "The procedure entry point inflateValidate" will pull up lots of zlib1.dll conflict results. 搜索错误“过程入口点inflateValidate”将产生许多zlib1.dll冲突结果。 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. SDL2_image-devel-2.0.4中的zlib1.dll(1.2.11)在1.2.8版本生成您报告的错误的地方起作用。 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. 删除zlib1.dll并找到较新的版本,还要考虑到您的PATH中可能已经存在另一个冲突的zlib1.dll,这会导致错误,请在PATH中检查DLL的其他副本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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