[√]_ITERATOR_DEBUG_LEVEL

简介: [√]_ITERATOR_DEBUG_LEVEL

error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“2”不匹配值“0”

模式
0 Debug 版本
2 Release 版本

  • 将 _ITERATOR_DEBUG_LEVEL 设置为 2(debug模式)或 0(release模式)
  • 【windows】 将 RuntimeLibrary 设置为 /MDd(debug模式)或 /MD(release模式)。
  • 【Linux】将 RuntimeLibrary 设置为 -g(debug模式)或 -O3(release模式)。
  • image.png

如何排查这个错误

LNK2038 mismatch detected for 'RuntimeLibrary': 
value 'MT\_StaticRelease'  文件对应的,依赖的lib
doesn't match 
value 'MTd\_StaticDebug' 项目对应的,当前的lib,一般都要和文件的对应
in cmake\_pch.obj 
项目:vld (vld\vld)  
文件:H:\proj\tank5\client\frameworks\qt-editor\build\cppformat.lib(format.obj)  1
  • MD:Dynamic
  • MT:Static

我做了一个简单的测试,从测试结果可以看出来:

image.png

解决办法,因为release模式会被编译器优化,关掉编译器优化即可。

错误2

mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in cmake_pch.obj
目录
相关文章
|
Linux 网络安全
【Linux】INFO: attempting to log in with the new key(s), to filter out any that are already...
【Linux】INFO: attempting to log in with the new key(s), to filter out any that are already...
525 0
|
5月前
Could not find method debug()
Could not find method debug()
247 59
|
4月前
|
Java
【ERROR】‘<>‘ operator is not allowed for source level below 1.7
【ERROR】‘<>‘ operator is not allowed for source level below 1.7
36 0
|
5月前
|
Java 数据库
log4j:WARN Please initialize the log4j system prop
log4j:WARN Please initialize the log4j system prop
39 1
|
5月前
|
API Android开发
List.size() 问题 Android studio: Verbose,Debug,Info,Warn,Error
List.size() 问题 Android studio: Verbose,Debug,Info,Warn,Error
33 0
|
5月前
|
Java
log4j:WARN Please initialize the log4j system properly.
log4j:WARN Please initialize the log4j system properly.
174 0
|
Web App开发
Chrome source code map - fail - cannot debug
Chrome source code map - fail - cannot debug
Chrome source code map - fail - cannot debug
my Note debug - add to function
Created by Wang, Jerry, last modified on Feb 03, 2015
my Note debug - add to function
why debug log could not be displayed in console
Created by Wang, Jerry on Mar 07, 2016
101 0
why debug log could not be displayed in console
|
安全 Java 测试技术
Debug ArrayList
还挺有意思的
254 0
Debug ArrayList