本文介绍了使用 SDL2 C++ 时,应用程序无法正确启动 (0xc000007b) 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,问题来了.最近我对 C++ 游戏编程产生了兴趣,我正在使用 SDL2 库.一切正常,直到我想加载 SDL2 图像库.我遇到的第一个问题是我使用 x64 库的第一个设置,但在运行代码时出现了一些问题,所以我将其更改为 x86.我将链接器 -> 附加库目录从 x64 更改为 x86,将平台从 x64 更改为所有平台,以及 VC++ 目录下的可执行目录和库目录更改为 x86,但问题仍然存在,并将调试器从 x64 更改为 x86.我尝试运行 dskchk,重新启动 PC 并重新安装 VS 2015,并且发生了同样的事情.有什么我遗漏的吗?

Ok so here's the problem. Recently I got interested in C++ game programming and I was working with SDL2 libraries. Everything worked fine up until I wanted to load SDL2 Image libraries. The first problem I encountered was that the first setup I was working with x64 libraries but there were some issues with running the code so I changed it to x86. I changed the Linker -> Additional Library Directories from x64 to x86, Platform from x64 to All platforms as well as Executable Directories and Library Directories under VC++ Directories to x86 but the problem persisted as well as changing the debugger from x64 to x86. I tried running the dskchk, restarting the PC and reinstalling VS 2015 and the same thing is happening. Is there anything I'm missing?

推荐答案

您的应用程序使用 x86 .lib 文件来构建,但在您运行时使用 x64 .dll 文件它.将所有 .dll 更改为 x86 版本.

Your app uses x86 .lib files to build, but x64 .dlls when you are running it. Change all the .dlls to x86 versions.

这篇关于使用 SDL2 C++ 时,应用程序无法正确启动 (0xc000007b) 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 08:52