_ITERATOR_DEBUG_LEVEL error in visual studio

后端 未结 3 830
野趣味
野趣味 2020-12-18 18:27

I am trying to compile JRTPLIB in Visual Studio 2010 on windows 7. It\'s been a true nightmare... but I\'m atleast narrowing down the problems.

This is left.

相关标签:
3条回答
  • 2020-12-18 19:07

    The solution:

    Project Pages >> Configuration Properties >> C,C++ >> Preprocessor >> Preprocessor Definitions
    

    Add _ITERATOR_DEBUG_LEVEL=0 in there worked. See also: How to set _ITERATOR_DEBUG_LEVEL in VS2010?

    0 讨论(0)
  • 2020-12-18 19:21

    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.

    0 讨论(0)
  • 2020-12-18 19:24

    I found another way to generate these errors.

    I was using the Visual Studio 2010 batch build to build all possible combinations of platform and configuration and I was getting these errors. Looking at the output revealed that batch build was not honoring the project dependencies -- hence linking a stale library from the Release build witha freshly compiled Debug obj file.

    Several lines later in the build output it built the Debug version of the library.

    Doing the "batch build" by hand (i.e. manually selecting the various combinations of platform and configuration) produced a clean build.

    Moral: Do not use Visual Studio 2010 batch build. I don't know if they've fixed this in later versions of VS.

    0 讨论(0)
提交回复
热议问题