简体   繁体   English

在项目设置(有时)中设置_HAS_ITERATOR_DEBUGGING = 0无效

[英]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. 我有一个Visual Studio 2008解决方案,其中包含许多项目,这些项目都在项目文件的预处理器定义设置中定义_HAS_ITERATOR_DEBUGGING = 0。 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. 我已经检查了解决方案中的每个文件,除了项目设置之外,没有定义_HAS_ITERATOR_DEBUGGING

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. 在解决方案#define _HAS_ITERATOR_DEBUGGING 0添加到每个stdafx.h的顶部可解决此问题,但我想知道为什么在项目预处理器定义部分中设置它在某些时候不起作用。 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). 偶尔咬我的一件事是项目设置很容易在不同的配置之间变得不同(例如Release与Debug)。 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 对于遇到问题的项目,请查看构建日志(BuildLog.htm - 它在Build Output窗口中显示的链接),并确保

-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). 选项显示在编译器命令行上(实际上在响应文件中,该命令行选项已传递给编译器)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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