如何在VS2010中设置_ITERATOR_DEBUG_LEVEL?

发布于 2024-11-02 14:04:33 字数 459 浏览 0 评论 0原文

我们正在使用另一个供应商提供的库,该库显然是使用错误的标志进行编译的,即 32 位调试模式下的 _ITERATOR_DEBUG_LEVEL = 0。虽然我已经向他们提交了错误报告,但我需要一个中间解决方案。我们自己不使用 stl,所以我可以自由地为使用所述库的子项目更改此标志。但我不知道该怎么做。我尝试的方法不起作用:

/D_ITERATOR_DEBUG_LEVEL=0
> LINK : warning LNK4044: unrecognized option '/D_ITERATOR_DEBUG_LEVEL=0'; ignored 

#define _ITERATOR_DEBUG_LEVEL 0
> Nothing happens

What's thepropersyntax or option to get the project to compile without Checked Iterators?

We are using a library by another vendor, which apparently was compiled with the wrong flags, namely _ITERATOR_DEBUG_LEVEL = 0 in 32bit-Debug-mode. While I have already filed a bug report with them, I need an intermediate solution. We do not use stl ourselves, so I am free to change this flag for the subproject that uses said library. But I cannot figure out how to do so. What I tried an didn't work:

/D_ITERATOR_DEBUG_LEVEL=0
> LINK : warning LNK4044: unrecognized option '/D_ITERATOR_DEBUG_LEVEL=0'; ignored 

#define _ITERATOR_DEBUG_LEVEL 0
> Nothing happens

What's the proper syntax or option to get the project to compile without checked iterators?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

书信已泛黄 2024-11-09 14:04:33

找到了解决方案。

项目页面/配置属性/C、C++/预处理器/预处理器定义。

添加“_ITERATOR_DEBUG_LEVEL = 0”在那里工作。

Found the solution.

Project Pages / Configuration Properties / C,C++ / Preprocessor / Preprocessor Definitions.

Add "_ITERATOR_DEBUG_LEVEL=0" in there worked.

究竟谁懂我的在乎 2024-11-09 14:04:33

正如附加信息一样:
项目页面/配置属性/C,C++/预处理器/预处理器定义,并根据目标将预处理器宏 _ITERATOR_DEBUG_LEVEL 设置为以下之一:

_ITERATOR_DEBUG_LEVEL = 0 // disabled (for release builds)
_ITERATOR_DEBUG_LEVEL = 1 // enabled (if _SECURE_SCL is defined)
_ITERATOR_DEBUG_LEVEL = 2 // enabled (for debug builds)

Just as additional information :
Project Pages / Configuration Properties / C,C++ / Preprocessor / Preprocessor Definitions and set the preprocessor macro _ITERATOR_DEBUG_LEVEL to one of the following depending on the target :

_ITERATOR_DEBUG_LEVEL = 0 // disabled (for release builds)
_ITERATOR_DEBUG_LEVEL = 1 // enabled (if _SECURE_SCL is defined)
_ITERATOR_DEBUG_LEVEL = 2 // enabled (for debug builds)
睫毛上残留的泪 2024-11-09 14:04:33

微软的这篇文章帮助我解决了这个问题:

https:// learn.microsoft.com/cpp/standard-library/iterator-debug-level

有一个编译器开关可以在 Visual Studio 2022 中设置该值:

/D_ITERATOR_DEBUG_LEVEL=0

This article from Microsoft helped me, to solve the issue:

https://learn.microsoft.com/cpp/standard-library/iterator-debug-level

There is a compiler switch to set the value in Visual Studio 2022:

/D_ITERATOR_DEBUG_LEVEL=0

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文