_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 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 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.
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.
Related Topics
Multiple Implicit Conversions on Custom Types Not Allowed
Structured Binding with [[Maybe_Unused]]
Why Do String Literals (Char*) in C++ Have to Be Constants
Issue with Cin When Spaces Are Inputted, Using String Class
How to Optimize Matrix Multiplication (Matmul) Code to Run Fast on a Single Processor Core
Write a Recursive Function That Reverses the Input String
Comparing Character Arrays and String Literals in C++
Should I Use Wchar_T When Using Utf-8
How Does C++ Preprocessors Work
Do All Virtual Functions Need to Be Implemented in Derived Classes
Initializing a C++ Std::Istringstream from an in Memory Buffer
C++ Boost: What's the Cause of This Warning
Set All Bytes of Int to (Unsigned Char)0, Guaranteed to Represent Zero
Sine Wave That Slowly Ramps Up Frequency from F1 to F2 for a Given Time
How to Use Cin.Fail() in C++ Properly
C++:Friend Declaration 'Declares a Non-Template Function
How to Use a Timer in C++ to Force Input Within a Given Time
How to Compare Two Time Stamp in Format "Month Date Hh:Mm:Ss" to Check +Ve or -Ve Value