丢失 DLL 的一般方法
我想每个人都时不时地遇到过缺少dll的问题。我想要得到的是查找并安装 dll 的“推荐”方法。使用depends.exe 可以很容易地找出缺少哪些dll。
I guess everyone has run into missing dll's issues from time to time. What I am trying to get is the 'recommended' method to find and install the dll's. Finding out which dll's are missing is easy enough using depends.exe.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不要再使用depends.exe,它跟不上Windows核心和并行缓存等部署策略的发展。尝试修复它给出的警告实际上会让你的机器变得非常糟糕。仅当程序实际上无法启动时才使用它作为提示。
Don't use depends.exe anymore, it hasn't kept up with developments in the Windows core and deployment strategies like the side-by-side cache. Trying to fix the warnings it gives will actually mess up your machine pretty badly. Only use it for hints if a program actually fails to start.
我经常遇到的 99% 的缺失 dll 错误都是缺少 C++ 运行时库(例如 =MSVC*.dll=)或 .Net 框架,开发人员在其中构建了动态链接到 C++ 运行时但尚未创建具有所需合并模块的安装程序,或者他们构建了一个调试版本,该版本链接到不允许您重新分发的调试运行时库。
在绝大多数情况下,只需安装正确的 Visual Studio 2005/2008 C++ 运行时(例如,请参阅 此处)或.Net框架将解决该问题。
99% of the missing dll errors that I tend to come across are missing C++ runtime libraries (eg =MSVC*.dll=) or the .Net framework, where the developer has built with dynamic linking to the C++ runtimes but hasn't created an installer with the required merge modules, or they have built a debug version which links against the debug runtime libraries which you are not permitted to redistribute.
In the vast majority of these cases, simply installing the correct Visual Studio 2005/2008 C++ runtimes (eg see here) or .Net framework will fix the problem.
这在很大程度上取决于缺少哪些 DLL 以及缺少它们的原因,我不知道有一个一刀切的答案。
我的建议是使用depends来查找丢失了哪些DLL,尝试找出这些DLL应该安装在哪里(以及应该用什么应用程序来安装它们),然后尝试重新安装该应用程序或找出发生了什么把dll搞砸了。
另一件需要检查的事情是 32 位/64 位不匹配,这有时会使 DLL 看起来丢失,尤其是在 64 位平台上。
或者,如果您使用 .NET,有时可能会遇到程序集版本和 GAC 问题。
你还可以检查 PATH 环境变量,我建议不要盲目地添加到你的 PATH 中来让它找到你想要的 DLL,这可能会导致各种其他奇怪的问题。
有时你必须修改 PATH 或复制文件才能使事情正常工作,但如果你能首先找出问题所在并修复它,通常会更好。
That depends greatly on which DLLs are missing and why they are missing, I don't know that there is a one-size-fits-all answer.
My advice would be to use depends to find which DLLs are missing, try to find out where those DLLs were supposed to be installed (and what application was supposed to install them), and then try to reinstall that application or find out what happened to screw up the dlls.
Another thing to check is for 32bit/64bit mismatches, that can make it seem like DLLs are missing sometimes, especially on 64bit platforms.
Or if you are using .NET, you can have trouble with assembly versions and the GAC sometimes.
You can also check the PATH environment variable, I would advise against blindly adding to your PATH to get it to find DLLs you want, that can cause all sorts of other weird problems.
Sometimes you have to hack around with the PATH or copy files to get things to work, but it is usually better if you can figure out what went wrong in the first place and fix it.
如果可能,请从其发布者的网站获取 DLL,然后按照发布者的说明进行安装。不要忘记遵守许可规则!
Get the DLL from its publisher's website, if possible, and then follow the publisher instructions to install. Don't forget to respect licensing rules!