在visual studio中有_ITERATOR_DEBUG_LEVEL个错误 [英] _ITERATOR_DEBUG_LEVEL error in visual studio

查看:636
本文介绍了在visual studio中有_ITERATOR_DEBUG_LEVEL个错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Windows 7上编译JRTPLIB在Visual Studio 2010中。这是一个真正的噩梦...但我至少缩小问题。



 错误3错误LNK2038:为_ITERATOR_DEBUG_LEVEL检测到不匹配:值'2' 0'in client.obj C:\Users\Johan-bar\Documents\Visual Studio 2010 \Projects\client\client\jrtplib.lib(rtpsession.obj)client 

我googled一吨,原因似乎是一个在调试模式下编译,而另一个编译在释放模式。 p>

我的目标是编译一个Release可执行文件,因为我想在不同的计算机上测试。



1)不是在发布模式,JRTPLIB或客户端(我的,试图编译的那个)?



2)如何更改ITERATOR_DEBUG_LEVEL?



干杯

解决方案

使用-D_ITERATOR_DEBUG_LEVEL = 0选项编译您使用的所有内容。这是默认情况下在VS 2010发布模式,但有些事情仍然建立与其他选项,所以不是二进制兼容。



在老视觉工作室有_SECURE_SCL和我不知道如果一些代码可能仍然使用它。放在某个地方(说成stdafx.h)静态检查这些匹配。

  #if _ITERATOR_DEBUG_LEVEL == 0&& _SECURE_SCL!= 0 
#error _SECURE_SCL!= 0 while _ITERATOR_DEBUG_LEVEL == 0
#endif


$ b b

如果你想看到什么值_ITERATOR_DEBUG_LEVEL,那么你可以在代码中使用一些#pragma消息告诉你。


I am trying to compile JRTPLIB in Visual Studio 2010 on windows 7. It's been a true nightmare... but I'm atleast narrowing down the problems.

This is left.

Error   3   error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in client.obj   C:\Users\Johan-bar\Documents\Visual Studio 2010\Projects\client\client\jrtplib.lib(rtpsession.obj)  client

I googled a ton and the cause seems to be one is compiled in debug mode while the other is compiled in release mode.

I am aiming to compile a Release executable because I want to test on different computers.

1) Which one is not in Release mode, JRTPLIB or client(mine, the one which is trying to compile)?

2) How does one change the ITERATOR_DEBUG_LEVEL? Both are using Runtime Library /MT and preprocessor definitions WIN32, _MT, along with the defaults I guess.

Cheers

解决方案

Compile everything you use with -D_ITERATOR_DEBUG_LEVEL=0 option. It is so by default in VS 2010 Release mode, but some things are still built with other options and so are not binary compatible.

In older visual studios there was _SECURE_SCL and i am not sure if some of code may still use it. Put somewhere (say into stdafx.h) a static check that these match.

#if _ITERATOR_DEBUG_LEVEL == 0 && _SECURE_SCL != 0 
#error _SECURE_SCL != 0 while _ITERATOR_DEBUG_LEVEL == 0 
#endif 

If you want to see what value _ITERATOR_DEBUG_LEVEL has then you can use some #pragma message in code to tell you.

这篇关于在visual studio中有_ITERATOR_DEBUG_LEVEL个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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