Error Lnk2038: Mismatch Detected for '_Iterator_Debug_Level': Value '0' Doesn't Match Value '2' in Main.Obj

Error LNK2038 : mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in XX.obj

Though not a perfect solution, I ended up creating a new project and reimporting all dependencies one after another, compiling in between to try and find the issue. After importing all libraries, the new project just worked. I then copied all of my code and compiled it in the new solution, which worked, so the issue has been resolved.

I saved a diff between the two project files, but couldn't find the issue (they are too different for me to make sense out of). Maybe someone with more experience can figure it out.

_iterator_debug_level value '0' doesn't match value '2'

It seems that you are mixing object files built with different settings. Try to do a full clean rebuild and check all project file settings to make sure that the _ITERATOR_DEBUG_LEVEL macro is the same (e.g., you are not mixing debug and release built objects).

error LNK2038: mismatch detected

If _ITERATOR_DEBUG_LEVEL > 1 is not supported in release mode and the error message implies that _ITERATOR_DEBUG_LEVEL == 2 in gurobi_c++mdd2010.lib, then either that lib or one of its dependencies must be a Debug build.

It's probably worth investigating this angle, so check here and make sure you are linking the correct lib, based on your project settings.

_ITERATOR_DEBUG_LEVEL error in visual studio

Compile everything you use with -D_ITERATOR_DEBUG_LEVEL=0 option. It is so by default in VS 2010 Release mode, but some things are still built with other options and so are not binary compatible.

In older visual studios there was _SECURE_SCL and i am not sure if some of code may still use it. Put somewhere (say into stdafx.h) a static check that these match.

#if _ITERATOR_DEBUG_LEVEL == 0 && _SECURE_SCL != 0 
#error _SECURE_SCL != 0 when _ITERATOR_DEBUG_LEVEL == 0
#endif

If you want to see what value _ITERATOR_DEBUG_LEVEL has then you can use some #pragma message in code to tell you.



Related Topics



Leave a reply



Submit