您当前的位置: 首页 >  ar
  • 4浏览

    0关注

    483博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

VS2019: LNK2019 无法解析的外部符号 __imp__invalid_parameter

高精度计算机视觉 发布时间:2022-06-07 23:45:06 ,浏览量:4

VS2019开发一个项目,报错:如下,

error LNK2001: unresolved external symbol __imp___CrtDbgReport 

error LNK2001: unresolved external symbol __imp___invalid_parameter

error LNK2001: unresolved external symbol __imp___CrtDbgReportW 

error LNK2001: unresolved external symbol __imp___CrtDbgReportW 

error LNK2001: unresolved external symbol __imp___CrtDbgReportW

error LNK2001: unresolved external symbol __imp___free_dbg 

error LNK2001: unresolved external symbol __imp___malloc_dbg

对应的中文版报错如下, 严重性    代码    说明    项目    路径    文件    行    禁止显示状态 错误    LNK2019    无法解析的外部符号 __imp__invalid_parameter, 错误    LNK2019    无法解析的外部符号 __imp__calloc_dbg, 错误    LNK2019    无法解析的外部符号 __imp__CrtDbgReport, 错误    LNK2019    无法解析的外部符号 __imp__free_dbg, 错误    LNK2019    无法解析的外部符号 __imp__malloc_dbg, 错误    LNK1120    5 个无法解析的外部命令    

看名称,应该是某个库找不到,但到底是哪个库呢?能过搜索后发现,是ucrtd.lib这个库。

具体可能考:

Visual Studio FeedbackDeveloper community 2https://developercommunity.visualstudio.com/t/5-unresolved-external-symbols-when-linking-vc-proj/593359其中有一段是这么说的,

The upgraded project is missing a reference to the Universal CRT, specifically ucrtd.lib. This library comes from the Windows 10 SDK and is part of the VS 2015/Windows 10 change which brings portions of the C-runtime into the OS. Details on this change and other potential issues you may find upgrading to VS 2015 and later can be found here:

Microsoft C++ porting and upgrading guide | Microsoft Docs

And the specific page related to the Universal CRT:

Upgrade your code to the Universal CRT | Microsoft Docs

From what I can tell, the following changes are needed to the supplied repro projects to resolve the link errors:

  • Add $(UniversalCRT_LibraryPath_x86) to Linker->General->“Additional Library Directories”
  • Add ucrtd.lib to Linker->Input->“Additional Dependencies”

本文结束

关注
打赏
1661664439
查看更多评论
立即登录/注册

微信扫码登录

0.0353s