简体   繁体   English

我的电脑缺少SDL.dll - VS 2010

[英]SDL.dll is missing from my computer - VS 2010

I'm trying to compile a SDL-program I've written, but when I do, this error shows up: 我正在尝试编译我编写的SDL程序,但是当我这样做时,会出现此错误:

The program can't start because SDL.dll is missing from your computer. 程序无法启动,因为您的计算机缺少SDL.dll。 Try reinstalling the program to fix this problem 尝试重新安装该程序以解决此问题

I have no idea as to why. 我不知道为什么。 I have SDL.dll. 我有SDL.dll。

  • I have put it in the correct folder: C:\\Windows\\System32 . 我把它放在正确的文件夹中: C:\\Windows\\System32

  • I have the correct PATHS to all the SDL headers and such as well. 我对所有SDL标头都有正确的路径,例如。

VS says: VS说:

Build succeeded: 1 建成功:1

and THEN the error above pops up on screen. 然后,屏幕上弹出上面的错误。

将它添加到您的调试文件夹或您的程序当前所在的目录中。

SDL.dll必须与应用程序位于同一目录中,或者位于PATH环境变量中的目录中。

If SDL.dll is 32-bit and you're running a 64-bit system you have to place the dll into /Windows/SysWOW64/ rather than /Windows/System32/ , which is used for 64-bit dlls. 如果SDL.dll是32位并且您运行的是64位系统,则必须将dll放入/Windows/SysWOW64/而不是/Windows/System32/ ,它用于64位dll。

EDIT: 编辑:
You probably shouldn't be deploying your DLLs by copying them into the System32 directory, unless they're common libraries that are used by several applications, and even then I would use discretion. 您可能不应该通过将DLL复制到System32目录来部署DLL,除非它们是多个应用程序使用的公共库,即使这样我也会谨慎使用。 For example, an application could update the DLL, which could break other applications that rely on an older version of the library. 例如,应用程序可能会更新DLL,这可能会破坏依赖于旧版本库的其他应用程序。

Instead, copy the DLLs into the same directory that the executable is being built in. If you're building and executing with Visual Studio it will look for the DLL in the Project directory, where your source files are probably located. 而是将DLL复制到构建可执行文件的同一目录中。如果您正在使用Visual Studio构建和执行它,它将在项目目录中查找源文件所在的DLL。

Just place your SDL.dll in the same folder and your problem will be solved. 只需将SDL.dll放在同一个文件夹中,您的问题就会解决。 And to answer to your problem with the PATH, you can specify in visual studio where he will look for executables while debugging. 要使用PATH回答您的问题,您可以在visual studio中指定他在调试时查找可执行文件。 Maybe this isn't set correctly and that's why VS can't find SDL.dll? 也许这没有正确设置,这就是为什么VS无法找到SDL.dll?

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

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