【问题标题】:Visual Studio error "LNK2019: unresolved external symbol"Visual Studio 错误“LNK2019:无法解析的外部符号”
【发布时间】:2013-06-15 16:10:10
【问题描述】:

我的程序中出现此错误。我不知道那是什么意思。你能帮我吗?

错误 3 错误 LNK2019:无法解析的外部符号 imp_CrtDbgReportW 在函数“public: class std::_Vector_const_iterator >> & __thiscall 中引用 std::_Vector_const_iterator >>::operator+=(int)" (??Y?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@PAVCommissionEmployee@@@std@@@std@@@std@@QAEAAV01@H@Z) C:\Users\Dell\Documents\Visual Studio 2012\Projects\Base-Commission 员工\Base-Commission 员工\main.obj

【问题讨论】:

标签: visual-c++


【解决方案1】:

请看here

vector 类会告诉你 at() 方法 在调试模式下失败。因此,对 CrtDbgReportW() 的引用, 在调试时显示诊断的运行时函数。当你 与 /MD 链接,您与运行时的发布版本链接 图书馆;一个什么都没有告诉你并且缺少 CrtDbgReportW() 导出。因此链接器错误。

您可以通过从预处理器中删除 _DEBUG 定义来解决此问题 定义。 如果您不想失去这个宝贵的工具,请告诉我们 与 /MDd 链接时出了什么问题。

【讨论】:

    【解决方案2】:

    如果您正在构建带有静态 CRT 链接 (/MT) 的调试版本,那么只需执行以下操作: #define _ITERATOR_DEBUG_LEVEL 0之前#include<vector> or #include<algorithm> and so on...

    【讨论】:

    • 这修复了它。将其包装为:#ifdef _DEBUG #define _ITERATOR_DEBUG_LEVEL 0 #include #endif
    猜你喜欢
    • 2014-06-10
    • 2014-10-09
    • 1970-01-01
    • 2023-03-28
    • 1970-01-01
    • 2020-07-09
    • 1970-01-01
    • 2014-08-26
    • 1970-01-01
    相关资源
    最近更新 更多