MSVCR80D.dll not found 没有找到MSVCR80D.dll

I ran in to this couple of days back.
Visual Studio 2005 threw up the following error message when i ran my CRT Win32/Console application in Debug mode.
---------------------------
<App Name> - Unable To Locate Component
---------------------------
This application has failed to start because MSVCR80D.dll was not found. Re-installing the application may fix this problem.
---------------------------
OK  
---------------------------
The app ran fine in Release mode though.
(BTW, The error message, the title and the OK were automatically generated!! we can 'copy' the entire content of a error dialog by pressing CTRL-C when the dlg is active)
The most interesting/worrying aspects of this were the facts that this application is a 'straight-from-the-wizard' application and that the app worked sporadically on repeated trials of clean-and-rebuild project. Repeated attempts of install/reinstall/repair didn't fix this.
Searching the net for similar issues led me to this http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=15218
So, according to the posts, the issue was due to a missing manifest file. But i was able to see two manifest files in the debug folder. In fact there are 2 debug folders. 1 in the <solution folder>/debug and the other <solution folder>/<project folder>/debug. The <solution>/debug contains the final output file and the <solution>/<project>/debug contains intermediate files. The .manifest files are present in the inner debug folder. I copied the '.embed.manifest' file to the outer debug folder and renamed it to <app name>.manifest. The app ran fine now. However, the fact that I had to manually do this meant that there was something wrong with this.
I started fiddling around with the project options and found that there is an option to ensure that the manifest is not embedded and its created externally. The setting is found in 'Project Properties->Configuration Properties->Mainfest Tool->Input and Output->Embed Manifest'. This is set to 'YES' by default. When this is set to NO the manifest is created in the outer debug directory and the app runs fine. Interestingly the app runs fine in the release version even when the manifest is embedded.
Resolution : Either of the following would fix this
1) Copy the <appname>.exe.embed.manifest from the inner debug folder to the outer debug folder and rename it to <appname>.exe.manifest. This is more of a hack. To ensure consistency between the executable and the manifest the manifest has to be copied everytime it can change. Use this reolution only when you specifically want an embedded manifest. ( setup a command line in the post build options to do this)
2)  Set the 'Embed Manifest' option to 'NO' for the debug version. (This would mean when you move(or ship) your debug executable to some other machine you have to move(or ship) the manifest file also.)

As of now, This looks like some sort of a bug in the creation of a debug executable with embedded manifest. I will update here if get to know something more.
******************
另给出其他解决方法
This means several things.
a) your console application does not have manifest. Either embedded inside or external. To check this, do the following:
      `1. Check for <appname>.exe. manifest next to exe. If it is not there, it may be embedded. Go to step 2.
        2. Open appname.exe in VS. See if it has RT_MANIFEST. Save it as a file and see if it has this line in it:      
<assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50215.4652" processorArchitecture="amd64" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
            If no RT_MANIFEST resource is present in the binary, go to step 3. If it is there, then go to step 4.
         3. You are building with /manifest:no. Don't do this, it is not supported scenario. Remove this linker switch and it all should work.
         4. msvcr80d.dll is not on the system. We need to know what version of VS is installed, what OS, what parts of VC++ have you selected during installations. Go ahead and file a bug on this on lab.msdn.microsoft.com.
******************
开始之前,确认:
1.
安装完成 Visual Studio 2005 ,确认安装的时候选中了 Unicode MFC version 以及 CRT source code (默认是选中的,如果你没有改动的话那么应该是装上了的);
2.
找到我们要动手术的目录,在 $(Program Files)/Microsoft Visual Studio 8/VC 下,找出 ATLMFC/SRC CRT/SRC 两个文件夹;
3.
(可选)安装 Platform SDK ,复制最新版本的 unicows.lib 放到 VC/PlatformSDK/LIB 中。 VC8 自带有 unicows.lib ,所以这一步可以不做。
一:编译 MSLU CRT 8.0
首先请备份一下 VC/Lib VC/CRT/SRC VC/ATLMFC/SRC VC/ATLMFC/lib 这四个文件夹(包括子文件夹),假如不小心改错的话可以直接从备份的文件夹里复制文件出来。
CRT
库需要编译的是这 6 DLL MSVCR80.DLL MSVCP80.DLL MSVCM80.DLL MSVCR80D.DLL MSVCP80D.DLL MSVCM80D.DLL 。为方便操作,我们把将要输出的 MSLU CRT 库文件改为别的名字以免和原来的混淆,分别改成: MSLUR80.DLL MSLUR80D.DLL MSLUP80.DLL MSLUP80D.DLL MSLUM80.DLL MSLUM80D.DLL (如果你改成别的名字的话,后面的操作请做相应的改正)。
1 )先把 SRC 目录下的相应文件改名:
copy _SAMPLE_.RC MSLUR80.RC
copy SAMPLE_P.RC MSLUP80.RC
copy SAMPLE_M.RC MSLUM80.RC
copy SAMPLE_P.DEF MSLUP80.DEF
copy SAMPLD_P.DEF MSLUP80D.DEF
copy SAMPLE_M.DEF MSLUM80.DEF
copy SAMPLD_M.DEF MSLUM80D.DEF
copy SAMPLE_U.DEF MSLUU80.DEF
copy SAMPLD_U.DEF MSLUU80D.DEF
copy Intel/_SAMPLE_.DEF Intel/MSLUR80.DEF
copy Intel/_SAMPLD_.DEF Intel/MSLUR80D.DEF
2 )打开 MSLUP80.DEF ,修改 LIBRARY SAMPLE_P LIBRARY MSLUP80
打开 MSLUP80D.DEF ,修改 LIBRARY SAMPLD_P LIBRARY MSLUP80D
打开 MSLUM80.DEF ,修改 LIBRARY SAMPLE_M LIBRARY MSLUM80
打开 MSLUM80D.DEF ,修改 LIBRARY SAMPLD_M LIBRARY MSLUM80D
打开 MSLUU80.DEF ,修改 LIBRARY SAMPLE_M LIBRARY MSLUM80 ;(注意此处不是 MSLUU80 而是 MSLUM80
打开 MSLUU80D.DEF ,修改 LIBRARY SAMPLD_M LIBRARY MSLUM80D ;(注意此处不是 MSLUU80D 而是 MSLUM80D
打开 /Intel/MSLUR80.DEF ,修改 LIBRARY _SAMPLE_ LIBRARY MSLUR80
打开 /Intel/MSLUR80D.DEF ,修改 LIBRARY _SAMPLD_ LIBRARY MSLUR80D
3 )打开 SRC/makefile 文件,修改开头部分为:
RETAIL_DLL_NAME=MSLUR80
RETAIL_DLL_NAME=MSLUR80
RETAIL_LIB_NAME=MSLUR80
RETAIL_DLLCPP_NAME=MSLUP80
RETAIL_LIBCPP_NAME=MSLUP80
RETAIL_DLLMIXED_NAME=MSLUM80
RETAIL_LIBMIXED_NAME=MSLUM80
RETAIL_LIBPURE_NAME=MSLUU80
RETAIL_PT_LIBMIXED_NAME=MLSUPTM
RETAIL_PT_LIBPURE_NAME=MLSUPTU
DEBUG_DLL_NAME=MSLUR80D
DEBUG_LIB_NAME=MSLUR80D
DEBUG_DLLCPP_NAME=MSLUP80D
DEBUG_LIBCPP_NAME=MSLUP80D
DEBUG_DLLMIXED_NAME=MSLUM80D
DEBUG_LIBMIXED_NAME=MSLUM80D
DEBUG_LIBPURE_NAME=MSLUU80D
DEBUG_PT_LIBMIXED_NAME=MLSUPTMD
DEBUG_PT_LIBPURE_NAME=MLSUPTUD
RC_NAME=MSLUR80
RCCPP_NAME=MSLUP80
RCMIXED_NAME=MSLUM80
54 行处修改 VCTOOLS ,注意自己的 VS2005 安装目录,假如安装到 E:/SoftWare/Microsoft Visual Studio 8/ 下,则此处改为:
VCTOOLS=E:/SoftWare/Microsoft Visual Studio 8/VC
1779, 1841, 1905, 1940, 2037, 2105, 2139, 2230
行的 kernel32.lib ,改为: unicows.lib kernel32.lib (一共 8 个不要改多了);
4 )打开 Visual Studio 2005 command prompt (从开始菜单或者是 vc8 的开发环境的菜单都可以启动),进入到 SRC 目录,输入命令设置 vctools ,假如 VS2005 安装在 E:/SoftWare/Microsoft Visual Studio 8/ 下,则输入:
Set vctools=E:/SoftWare/Microsoft Visual Studio 8/VC
完成后输入 bldnt 启动 SRC 目录下的 bldnt.bat 批处理文件编译 CRT 库。
译者:我编译的时候出来好多 warning ,不管他最后还是编译完成了。
5 )编译完成之后 lib 文件都放在 SRC/BUILD/INTEL/ 目录下,把文件名字改回来以便以前的程序可以链接,而且下面编译 MFC 库也需要。 DLL 文件不用改,新的 lib 文件知道该链接到谁那里。改名:
copy MLSUPTM.LIB PTRUSTM.LIB
copy MLSUPTMD.LIB PTRUSTMD.LIB
copy MLSUPTU.LIB PTRUSTU.LIB
copy MLSUPTUD.LIB PTRUSTUD.LIB
copy MSLUR80.LIB MSVCRT.LIB
copy MSLUR80D.LIB MSVCRTD.LIB
copy MSLUP80.LIB MSVCPRT.LIB
copy MSLUP80D.LIB MSVCPRTD.LIB
copy MSLUM80.LIB MSVCMRT.LIB
copy MSLUM80D.LIB MSVCMRTD.LIB
copy MSLUU80.LIB MSVCURT.LIB
copy MSLUU80D.LIB MSVCURTD.LIB
6 )把改名后的 lib 文件复制到 VC/LIB 目录下覆盖原来的文件。
7 )把步骤( 4 )、( 5 )、( 6 )再执行一次来重建 MSLUP80(D).DLL 和静态库,以便他们能链接到我们自己的 MSVCRT(D).LIB (指向我们的 MSLUR80(D).DLL )。
关掉 VS2005 command prompt ,因为编译 CRT 库的时候定义了许多环境变量,这些会使后面 MFC 库的编译出现错误。
6
个新的 DLL 文件都在 /VC/crt/src/build/intel 下,把这 6 个文件复制到系统目录下。
二:编译 MSLU MFC 8.0 Unicode 版本
MFC
库需要编译的是这 4 DLL
MFC80U.DLL (Unicode Release)
MFC80UD.DLL (Unicode Debug)
MFCM80U.DLL (Mixed mode/Managed Unicode Release)
MFCM80UD.DLL (Mixed mode/Managed Unicode Debug)

为方便操作,我们把将要输出的 MSLU CRT 库文件改为别的名字以免和原来的混淆,分别改成:
MFC80LU.DLL
MFC80LUD.DLL
MFCM80LU.DLL
MFCM80LUD.DLL
(如果你改成别的名字的话,后面的操作请做相应的改正)。
1 )打开 VC/ATLMFC/SRC/MFC/MFCDLL.MAK ,在 274 307 行的 link @<< ,后面插入一行变成:
 link @<<
/nod:kernel32.lib /nod:advapi32.lib /nod:user32.lib /nod:gdi32.lib /nod:shell32.lib /nod:comdlg32.lib /nod:version.lib /nod:mpr.lib /nod:rasapi32.lib /nod:winmm.lib /nod:winspool.lib /nod:vfw32.lib /nod:secur32.lib /nod:oleacc.lib /nod:oledlg.lib /nod:sensapi.lib
180
行的
LIBS=$(CRTDLL) kernel32.lib gdi32.lib msimg32.lib user32.lib uuid.lib daouuid.lib htmlhelp.lib shlwapi.lib $(PROFLIB)
改为:
LIBS=$(CRTDLL) unicows.lib kernel32.lib advapi32.lib comdlg32.lib shell32.lib oledlg.lib winspool.lib oleacc.lib gdi32.lib msimg32.lib user32.lib uuid.lib daouuid.lib htmlhelp.lib shlwapi.lib $(PROFLIB)
(此处不同于原文。原文为:
LIBS=$(CRTDLL) unicows.lib kernel32.lib gdi32.lib msimg32.lib user32.lib uuid.lib daouuid.lib htmlhelp.lib shlwapi.lib $(PROFLIB)
译者依照原文修改,编译的时候出现了错误,增加数个 lib 文件后编译通过)
2 )打开 VC/ATLMFC/SRC/MFCM/MFCMDLL.MAK ,在 253 272 行的 link @<< ,后面插入一行变成:
 link @<<
/nod:kernel32.lib /nod:advapi32.lib /nod:user32.lib /nod:gdi32.lib /nod:shell32.lib /nod:comdlg32.lib /nod:version.lib /nod:mpr.lib /nod:rasapi32.lib /nod:winmm.lib /nod:winspool.lib /nod:vfw32.lib /nod:secur32.lib /nod:oleacc.lib /nod:oledlg.lib /nod:sensapi.lib
215
行的
LIBS=$(CRTDLL) $(CRTMDLL) mscoree.lib kernel32.lib gdi32.lib msimg32.lib user32.lib /
改为:
LIBS=$(CRTDLL) $(CRTMDLL) mscoree.lib unicows.lib kernel32.lib advapi32.lib comdlg32.lib shell32.lib oledlg.lib winspool.lib mpr.lib oleacc.lib gdi32.lib msimg32.lib user32.lib /
(此处原文为:
LIBS=$(CRTDLL) $(CRTMDLL) mscoree.lib unicows.lib kernel32.lib gdi32.lib msimg32.lib user32.lib /
其余说明同上)
3 )打开 /VC/atlmfc/src/mfcm/INTEL/mfcm80u.def 文件,把第 10 行的 LIBRARY mfcm80u 改为:
LIBRARY mfcm80Lu
打开 /VC/atlmfc/src/mfcm/INTEL/mfcm80ud.def 文件,把第 10 行的 LIBRARY mfcm80ud 改为:
LIBRARY mfcm80Lud
4 )打开 /VC/atlmfc/src/mfcm/wfrmcmd.cpp 文件, 251 行的 #error Following information required to build private version // 注释掉或者直接把该行删掉; 253 行的 [assembly: AssemblyTitle("")]; 改为:
[assembly: AssemblyTitle("mfcm80L")];
5 )打开 /VC/atlmfc/src/mfcm/interfaces/AssemblyInfo.cpp 文件, 78 行的 #error Following information required to build private version // 注释掉或者直接把该行删掉; 85 行的 [assembly: AssemblyTitle("")]; 改为:
[assembly: AssemblyTitle("mfcm80Lifaces")];
6 )在 /VC/atlmfc/src/ 下建立一个批处理文件: buildmfc.bat ,内容为:
nmake -f atlmfc.mak MFC libname=MFC80L
7 )打开 Visual Studio 2005 command prompt ,进入目录 /VC/atlmfc/src/ ,输入 buildmfc 执行 buildmfc.bat 编译 MFC 库。
编译完成之后,在 /VC/atlmfc/src/mfc/intel 下有 MFC80LU.DLL MFC80LUD.DLL ,在 /VC/atlmfc/src/mfcm/INTEL 下有 MFCM80LU.DLL MFCM80LUD.DLL ,把这 4 DLL 文件复制到系统目录下;在 /VC/atlmfc/lib/INTEL 下有 MFC80LU.LIB MFC80LUD.LIB MFCM80LU.lib MFCM80LUD.lib ,把文件名改为:
MFC80U.LIB
MFC80UD.LIB MFCM80U.lib MFCM80UD.lib
把这四个 lib 文件复制到 /VC/atlmfc/lib 下覆盖原来的文件就完成了。
 
\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib 的目录 2009-09-06 16:17 . 2009-09-06 16:17 .. 2006-03-03 23:19 13,712 Bits.Lib 2006-03-03 23:19 4,196 credui.lib 2006-03-03 23:19 57,730 daouuid.lib 2006-03-03 23:19 527,310 ddao35.lib 2006-03-03 23:19 531,012 ddao35d.lib 2006-03-03 23:19 528,038 ddao35u.lib 2006-03-03 23:19 532,702 ddao35ud.lib 2006-03-03 23:19 14,610 WinFax.Lib 2006-03-03 23:19 206,996 GdiPlus.lib 2006-03-03 23:20 27,500 HelpCenterInterfaces.tlb 2006-03-03 23:20 64,608 HelpServiceInterfaces.tlb 2006-03-03 23:21 13,252 p2p.lib 2006-03-03 23:21 11,218 p2pgraph.lib 2006-03-03 23:21 1,380,352 atlsd.pdb 2006-03-03 23:23 121,974 WiaGuid.Lib 2006-03-03 23:23 19,212 WiaScr.Tlb 2006-03-03 23:23 10,152 esebcli2.lib 2006-03-03 23:23 129,732 cdoex.tlb 2006-03-03 23:23 26,608 cdoexm.tlb 2006-03-03 23:23 10,832 exevtsnk.tlb 2006-03-03 23:23 7,888 ActiveDS.Lib 2006-03-03 23:23 99,122 ADSIid.Lib 2006-03-03 23:23 53,222 Wldap32.Lib 2006-03-03 23:23 55,600 CDOSys.Tlb 2006-03-03 23:23 6,254 certadm.lib 2006-03-03 23:23 217,676 certidl.lib 2006-03-03 23:23 59,044 Crypt32.Lib 2006-03-03 23:23 5,516 ComSvcs.Lib 2006-03-03 23:23 75,386 DtcHelp.Lib 2006-03-03 23:23 2,106 Mtx.Lib 2006-03-03 23:23 1,734 mtxdm.lib 2006-03-03 23:23 121,030 Svcguid.Lib 2006-03-03 23:23 63,400 xaSwitch.Lib 2006-03-03 23:23 3,364 xoleHlp.Lib 2006-03-03 23:23 6,402 Icm32.Lib 2006-03-03 23:23 1,978 Icmui.Lib 2006-03-03 23:23 17,036 Mscms.Lib 2006-03-03 23:23 620,890 MMC.Lib 2006-03-03 23:23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值