3

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

Maroun
  • 94,125
  • 30
  • 188
  • 241
Hamid Hoseini
  • 123
  • 2
  • 3
  • 7
  • 1
    Your title is very general. Please edit it. – Maroun Jun 19 '13 at 08:02
  • 1
    it can be the solution for your problem here http://stackoverflow.com/a/6004441/896258 – mihai Jun 19 '13 at 08:03
  • 1
    This exact question was answered here: http://social.msdn.microsoft.com/Forums/vstudio/en-US/5e126c79-77f3-4d50-a47f-a9ce35cff0a4/unresolved-external-symbol-impcrtdbgreportw – rein Jun 19 '13 at 08:04

2 Answers2

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.

Leo Chapiro
  • 13,678
  • 8
  • 61
  • 92
1

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...

Andrey
  • 11
  • 1