1

There are lots of questions on this issue, but I'm struggling to get the answers to work for me. I have the specific error message:

gurobi_c++mdd2010.lib(Env.2010.omdd) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in DataHelper.obj

in visual studio 2010, in a release x64 build. The Gurobi library is 3rd party software, and DataHelper is my class.

Setting _ITERATOR_DEBUG_LEVEL=0 in DataHelper doesn't fix the problem, and I do not appear to be linking against 'debug' .lib or .dll in my files. _SECURE_SCL is not set in my files.

I tried to set _ITERATOR_DEBUG_LEVEL=2 in the preprocessor definitions, and I get:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\yvals.h(113): fatal error C1189: #error :  _ITERATOR_DEBUG_LEVEL > 1 is not supported in release mode.

Can anyone confirm the problem is on my side, or on the 3rd party side, and suggest any workarounds if it is the 3rd party library?

Thanks Melanie

Melanie
  • 1,349
  • 2
  • 17
  • 27
  • by accident, are you building in release level an having _SECURE_SCL=1? ( also have a look here: http://stackoverflow.com/questions/4080668/iterator-debug-level-value-0-doesnt-match-value-2 ) – Najzero May 07 '13 at 05:57
  • @Najzero: I've just checked, and search can't find it. – Melanie May 07 '13 at 06:10
  • What if you set `_ITERATOR_DEBUG_LEVEL=2` in DataHelper? – Roger Rowland May 07 '13 at 06:17
  • @RogerRowland - different error: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\yvals.h(113): fatal error C1189: #error : _ITERATOR_DEBUG_LEVEL > 1 is not supported in release mode. – Melanie May 07 '13 at 06:48
  • @Melanie Then is it possible that you are linking a Debug lib into your Release project? – Roger Rowland May 07 '13 at 07:01
  • @RogerRowland: I've checked, and I don't think so. And rechecked :) I don't know what the build settings are for the 3rd party library. – Melanie May 07 '13 at 07:09
  • @Melanie - ok, but 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. – Roger Rowland May 07 '13 at 07:16
  • @Melanie - check here http://www.gurobi.com/documentation/5.5/quick-start-guide/node138 and make sure you are linking the correct lib, based on your project settings. – Roger Rowland May 07 '13 at 07:18
  • @RogerRowland - agreed. I'm having some success with _ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH. – Melanie May 07 '13 at 07:19
  • @RogerRowland - the answer was wrong gurobi lib. If you write it up, I'll accept it. Thanks. – Melanie May 08 '13 at 00:33

3 Answers3

1

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.

Roger Rowland
  • 25,885
  • 11
  • 72
  • 113
0

I had a similar problem with a solution that I migrated from VS2005 to VS2010. It had two projects, a static library and an executable. Apparently there are multiple ways to instruct VS2010 to link a static library into an executable. One of those methods is via "Framework and References" on Property Pages for the executable's project. Click on "Add New Reference..." and add the static library here and it will give the linker error described in the OP's question because it doesn't care about debug vs release builds - it will grab the same static library for both, which results in an error for one of the two. My solution was to remove the reference (click "Remove Reference"), and then use the "Linker > Input > Additional Dependencies" and "Linker > General > Additional Library Directories".

Pops
  • 1
0

You need to link gurobi_c++md2010.lib instead of gurobi_c++mdd2010.lib.

The second d in mdd stands for debug.

rllb
  • 31
  • 8