vc编译去掉vcruntime140.dll依赖

为去除vc编译后的程序对vcruntime140.dll的依赖,需将项目属性设置为多线程(/MT)。然而,这可能导致LNK2001错误,如__except_handler4_common和__imp__strstr。解决方案是将相应库添加到连接器的附加依赖项,如libvcruntime.lib。注意,libvcruntime.lib仍可能依赖vcruntime140.dll,而以lib开头的libxxx.lib才是真正静态链接库。对于找不到的函数,可以直接声明并封装vc自带的函数。
摘要由CSDN通过智能技术生成

属性-配置属性-c/c++-代码生成-运行库:多线程(/MT)

然后会发生一些诸如:

LNK2001 无法解析的外部符号 __except_handler4_common     msvcrt.lib

LNK2001 无法解析的外部符号 __imp__strstr

等问题。

__except_handler4_common:

The error message is actually saying the the function __except_handler4, defined in MSVCRT.LIB, references the undefined symbol __except_handler4_common. So it's not your code that's making the this reference, it's Visual Studio 2015's code.

The symbol __except_handler4_common is defined in vcruntime.lib. This file should be automatically be

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值