_ITERATOR_DEBUG_LEVEL = 1是什么意思? [英] What does _ITERATOR_DEBUG_LEVEL = 1 mean?

查看:187
本文介绍了_ITERATOR_DEBUG_LEVEL = 1是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VS2010,C ++项目我得到这个错误时链接在x64 /版本:



错误LNK2038:检测到不匹配'_ITERATOR_DEBUG_LEVEL':值'0' t匹配值'1'



所有其他配置/平台组合链接很好。因此,静态库建立与_ITERATOR_DEBUG_LEVEL设置为0和.dll,它依赖于它以某种方式已_ITERATOR_DEBUG_LEVEL设置为1.我试图找出这是什么意思,所以我可以找出如何关闭它!



在Google搜索中发现的对此错误的唯一引用是_ITERATOR_DEBUG_LEVEL与值0和2冲突。这表示尝试将发行版与调试版链接。但我相信这不是这里的情况。

解决方案

挣扎一小时后,我想出了这个问题,

  _ITERATOR_DEBUG_LEVEL = 0(在发布模式下)
_ITERATOR_DEBUG_LEVEL = 1(如果定义了_SECURE_SCL, $ b _ITERATOR_DEBUG_LEVEL = 2(在调试模式下)

不知何故,我将_SECURE_SCL定义为预处理器定义我的DLL的Release / x64配置,我不得不眯着眼睛真的很难注意到它。一旦我删除了该定义,错误就消失了。



编辑:我发现这个关于msdn的漂亮讲座/教程说明_ITERATOR_DEBUG_LEVEL 。不幸的是,它需要一个相当新版本的Microsoft Silverlight来观看。


In VS2010, C++ project I get this error when linking in x64/Release:

error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '1'

All other configuration/platform combinations link just fine. So a static library is built with _ITERATOR_DEBUG_LEVEL set to 0 and the .dll that depends on it somehow has _ITERATOR_DEBUG_LEVEL set to 1. I'm trying to figure out what that means so I can figure out how to turn it off!

The only references to this error that I found while Googling are when _ITERATOR_DEBUG_LEVEL's conflict with values of 0 and 2. That indicates an attempt to link release with debug. But I'm sure that's not the case here.

解决方案

Well, after struggling with this for an hour I figured it out right after I asked the question... for posterity:

_ITERATOR_DEBUG_LEVEL = 0 (in release mode)
_ITERATOR_DEBUG_LEVEL = 1 (in release mode if _SECURE_SCL is defined)
_ITERATOR_DEBUG_LEVEL = 2 (in debug mode)

Somehow I had _SECURE_SCL defined as a preprocessor definition only in the Release/x64 configuration of my DLL and I had to squint really hard to notice it. Once I removed that definition, the error went away.

Edit: I found this nice lecture/tutorial on msdn that (among other things) explains _ITERATOR_DEBUG_LEVEL. Unfortunately, it does require a fairly recent version of Microsoft Silverlight to watch.

这篇关于_ITERATOR_DEBUG_LEVEL = 1是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆