如何解决VS中“找不到MSVCR80.dll”的问题

本文提供了解决VC++程序中出现的依赖问题的方法,包括通过在cpp文件中添加特定的代码指令,调整项目属性设置,以及修改配置文件等手段来确保程序能够正确引用所需的动态链接库。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  • 目前有三种解决方法。

1, 在程序cpp文件里加上下面句子:

#ifdef _DEBUG
#define __LIBRARIES_SUB_VERSION    Debug
#else
#define __LIBRARIES_SUB_VERSION   
#endif
// Manifest for the CRT
#pragma comment(linker,/manifestdependency:/type= win32 /
    name= __LIBRARIES_ASSEMBLY_NAME_PREFIX .
    __LIBRARIES_SUB_VERSION CRT /
    version= _CRT_ASSEMBLY_VERSION /
    processorArchitecture= x86 /)
// Manifest for the MFC
#pragma comment(linker,/manifestdependency:/type= win32 /
    name= __LIBRARIES_ASSEMBLY_NAME_PREFIX .
    __LIBRARIES_SUB_VERSION MFC /
    version= _CRT_ASSEMBLY_VERSION /
    processorArchitecture= x86 /)
#pragma comment(linker,/manifestdependency:/type= win32 /
    name= __LIBRARIES_ASSEMBLY_NAME_PREFIX .MFCLOC /
    version= _CRT_ASSEMBLY_VERSION /
    processorArchitecture= x86 /)

可参考:

http://www.codeproject.com/cpp/PrivateAssemblyProjects.asp?msg=2122107

2, 在程序cpp文件里加上下面句子:

#pragma comment(linker, "/"/manifestdependency:type='Win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='X86' publicKeyToken='1fc8b3b9a1e18e3b' language='*'/"")

可参考:

http://jewelry-wolf.spaces.live.com/blog/cns!9041D1290EF347B0!591.entry

3, 在项目属性 C/C++ 的Command Line 里加上

       /D _VC80_UPGRADE=0x0710

      可以解决debug版本程序运行不了的问题。

4. 删除project目录下的debug子目录。只能暂时解决问题,新建project时还是会出现问题。

*5. Another option is to add the following line in Project -> Properties ->

[Debug Configuration] -> Configuration Properties -> Linker -> Manifest
File -> Additional Manifest Dependencies:

type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0'
processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'

This will add the appropriate reference to MSVCR80.dll, and will not force
you to use static libs.
这种方法比较彻底。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值