How to set _ITERATOR_DEBUG_LEVEL in VS2010?

核能气质少年 提交于 2019-12-18 14:17:19

问题


We are using a library by another vendor, which apparently was compiled with the wrong flags, namely _ITERATOR_DEBUG_LEVEL = 0 in 32bit-Debug-mode. While I have already filed a bug report with them, I need an intermediate solution. We do not use stl ourselves, so I am free to change this flag for the subproject that uses said library. But I cannot figure out how to do so. What I tried an didn't work:

/D_ITERATOR_DEBUG_LEVEL=0
> LINK : warning LNK4044: unrecognized option '/D_ITERATOR_DEBUG_LEVEL=0'; ignored 

#define _ITERATOR_DEBUG_LEVEL 0
> Nothing happens

What's the proper syntax or option to get the project to compile without checked iterators?


回答1:


Found the solution.

Project Pages / Configuration Properties / C,C++ / Preprocessor / Preprocessor Definitions.

Add "_ITERATOR_DEBUG_LEVEL=0" in there worked.




回答2:


Just as additional information : Project Pages / Configuration Properties / C,C++ / Preprocessor / Preprocessor Definitions and set the preprocessor macro _ITERATOR_DEBUG_LEVEL to one of the following depending on the target :

_ITERATOR_DEBUG_LEVEL = 0 // disabled (for release builds)
_ITERATOR_DEBUG_LEVEL = 1 // enabled (if _SECURE_SCL is defined)
_ITERATOR_DEBUG_LEVEL = 2 // enabled (for debug builds)


来源:https://stackoverflow.com/questions/5727815/how-to-set-iterator-debug-level-in-vs2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!