C++ 程序无法启动,因为您的计算机缺少 mfc120ud.dll
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22939558/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The program can't start because mfc120ud.dll is missing from your computer
提问by Lucie kulza
I'm trying to run an application that I've recently developped onto another computer and which I've compiled using VS2013.
我正在尝试运行我最近在另一台计算机上开发并使用 VS2013 编译的应用程序。
Running it I get:
运行它我得到:
The program can't start because mfc120ud.dll is missing from your computer. Try reinstalling the program to fix this problem.
程序无法启动,因为您的计算机缺少 mfc120ud.dll。尝试重新安装程序以解决此问题。
I've searched the mfc120ud.dll from the net but without any result. I've copied/pasted this dll file from the computer on which I've developed that app onto the system32 of the other computer, doing that implies:
我从网上搜索了 mfc120ud.dll 但没有任何结果。我已经将这个 dll 文件从我开发该应用程序的计算机复制/粘贴到另一台计算机的 system32 上,这样做意味着:
C:\Users\u\System32\mfc120ud.dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support.
C:\Users\u\System32\mfc120ud.dll 不是为在 Windows 上运行而设计的,或者它包含错误。尝试使用原始安装介质再次安装该程序,或联系您的系统管理员或软件供应商以获得支持。
Knowing that the computer on which I'm developing is a 64-bits one and the other one is 32-bits, and that I've copied/pasted the mfc120ud.dll version from System32, how do I to fix this issue?
知道我正在开发的计算机是 64 位的,而另一个是 32 位的,并且我已经从 System32 复制/粘贴了 mfc120ud.dll 版本,我该如何解决这个问题?
回答by David Heffernan
The program can't start because mfc120ud.dll is missing from your computer. Try reinstalling the program to fix this problem.
程序无法启动,因为您的计算机缺少 mfc120ud.dll。尝试重新安装程序以解决此问题。
That is one of the debug libraries for MFC. That's the library that you link against when you build debug releases of your program. It is present on your developer machine, but you cannot redistribute it.
这是 MFC 的调试库之一。这是您在构建程序的调试版本时链接的库。它存在于您的开发人员机器上,但您无法重新分发它。
You need to do the following:
您需要执行以下操作:
- Build your project for release. This will link against the release versions of any runtime DLLs.
- Install the MSVC and MFC redistributable dependencies on any machine on which you plan to run your program. An alternative is to install the runtime DLLs in the same directory as your executable.
- 构建您的项目以进行发布。这将链接到任何运行时 DLL 的发布版本。
- 在您计划运行程序的任何计算机上安装 MSVC 和 MFC 可再发行依赖项。另一种方法是将运行时 DLL 安装在与可执行文件相同的目录中。
I've copied/pasted the mfc120ud.dll version from System32
我已经从 System32 复制/粘贴了 mfc120ud.dll 版本
You are not allowed to do that. Retrace your steps and undo that.
你不能这样做。回溯您的步骤并撤消该操作。
回答by manatails
Check if you've accidentally defined _DEBUG in your preprocessor definitions.
检查您是否不小心在预处理器定义中定义了 _DEBUG。
I once had the same error when I copy pasted settings from the debug build.
当我从调试版本复制粘贴的设置时,我曾经遇到过同样的错误。
回答by Anurag Daware
For me, I build the project using VS2013 xp mode. Then deployed on window XP system. Then I got error that mfc120ud.dll is missing. I installed vcredist.exe for vs2013, which fixed the issue.I am able to run my MFC app.
对我来说,我使用 VS2013 xp 模式构建项目。然后部署在window XP系统上。然后我得到了 mfc120ud.dll 丢失的错误。 我为 vs2013 安装了 vcredist.exe,解决了这个问题。我能够运行我的 MFC 应用程序。
回答by user8128167
When I encountered a similar problem, first installed the VS 2013 C++ redistributables vcredist_x86.exe and vcredist_x64.exe (https://support.microsoft.com/en-us/help/3138367/update-for-visual-c-2013-and-visual-c-redistributable-package), then I determined what dependencies the file had:
当我遇到类似的问题时,首先安装了 VS 2013 C++ redistributables vcredist_x86.exe 和 vcredist_x64.exe ( https://support.microsoft.com/en-us/help/3138367/update-for-visual-c-2013- and-visual-c-redistributable-package),然后我确定了该文件具有哪些依赖项:
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin>dumpbin.exe /dependents "C:\Temp\MyLibrary.dll"
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file C:\Temp\MyLibrary.dll
File Type: DLL
Image has the following dependencies:
mfc120d.dll
MSVCR120D.dll
KERNEL32.dll
USER32.dll
OLEAUT32.dll
mscoree.dll
Image has the following delay load dependencies:
MyLibraryCoreD.dll
Summary
5000 .data
2000 .nep
1000 .pdata
4E000 .rdata
1000 .reloc
1000 .rsrc
10000 .text
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin>
Next I searched the registry and it did not find mfc120d.dll, only mfc120.dll and mfc120u.dll (see https://serverfault.com/questions/576831/how-do-i-know-if-a-dll-is-registered), so instead of using the debug version I switched to the release version which uses mfc120.dll and the application worked.
接下来我搜索了注册表,没有找到 mfc120d.dll,只有 mfc120.dll 和 mfc120u.dll(参见https://serverfault.com/questions/576831/how-do-i-know-if-a-dll- is-registered),所以我没有使用调试版本,而是切换到使用 mfc120.dll 并且应用程序工作的发布版本。