Setting _HAS_ITERATOR_DEBUGGING = 0 in the project settings (sometimes) does not affect

I have a Visual Studio 2008 solution with a number of projects that all define _HAS_ITERATOR_DEBUGGING = 0 in the preprocessor definition parameters in the project files. But this only works on some of the projects, while others are still compiled with iterator debugging turned on.

I checked every file in the solution, and _HAS_ITERATOR_DEBUGGING , other than the project settings, was not specified _HAS_ITERATOR_DEBUGGING .

Adding #define _HAS_ITERATOR_DEBUGGING 0 to the beginning of each stdafx.h in the solution works around the problem, but I would like to know why setting this in the "Project Preprocessor Definitions" section does not work for a while. Any ideas?

+4
source share
1 answer

One thing that bites me from time to time is that project settings can easily vary between different configurations (e.g. Release vs. Debug). Make sure the option is set or the configuration you are building. And, of course, that the definition is spelled correctly ...

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

 -D "_HAS_ITERATOR_DEBUGGING=0" 
Option

displayed on the compiler command line (actually in the response file, which has command line parameters passed to the compiler).

+4
source

All Articles