3
votes

I get this error in my program. I don't know what that means. can you help me ?

Error 3 error LNK2019: unresolved external symbol imp_CrtDbgReportW referenced in function "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-Commission Employee\main.obj

2
Your title is very general. Please edit it. - Maroun
it can be the solution for your problem here stackoverflow.com/a/6004441/896258 - mihai
This exact question was answered here: social.msdn.microsoft.com/Forums/vstudio/en-US/… - rein

2 Answers

10
votes

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.

1
votes

If you are building a debug version with a static CRT linking (/MT) then just do this: #define _ITERATOR_DEBUG_LEVEL 0 before#include<vector> or #include<algorithm> and so on...