简体   繁体   中英

Setting _HAS_ITERATOR_DEBUGGING=0 in project settings (sometimes) has no effect

I have a Visual Studio 2008 solution with a number of projects that all define _HAS_ITERATOR_DEBUGGING=0 in the Preprocessor Definitions setting in project files. But this only seems to work on some of the projects, while others still get compiled with iterator debugging enabled.

I have checked every file in the solution, and nowhere is _HAS_ITERATOR_DEBUGGING defined other than the project settings.

Adding #define _HAS_ITERATOR_DEBUGGING 0 to the top of each stdafx.h in the solution works around the issue, but I would like to know why setting this in the project Preprocessor Definitions section is not working some of the time. Any ideas?

One thing that bites me every now and then is that project settings can easily become different between different configurations (Release vs. Debug for example). Make sure the setting is there or the configuration you're building. And of course that the define is spelled correctly...

For the projects that are having the problems, take a look at the build log (BuildLog.htm - a link to it shows up in the Build Output window) and make sure the

-D "_HAS_ITERATOR_DEBUGGING=0" 

option shows on the compiler command line (actually in the response file that has the command line options passed to the compiler).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM