3

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

错误 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 Employee\Base-佣金员工\main.obj

4

2 回答 2

10

Take a look here please:

The vector class is going to want to tell you that the at() method failed in debug mode. Thus the reference to CrtDbgReportW(), the runtime function that displays diagnostics while debugging. When you link with /MD, you link with the release version of the run-time library; the one that doesn't tell you anything and is missing the CrtDbgReportW() export. Thus the linker error.

You can fix this by removing the _DEBUG define from the preprocessor definitions. If you don't want to lose that valuable tool, tell us what goes wrong when you link with /MDd.

于 2013-06-19T08:04:17.357 回答
1

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

于 2014-08-27T18:21:02.463 回答