问题描述
我正在尝试将我的一个小型应用程序从Win XP和VS 2005移植到Win 7和VS 2010.
I am trying to port a small app of mine from Win XP and VS 2005 to Win 7 and VS 2010.
应用程序在Debug模式下编译并运行平稳,但是在Release模式下,出现以下错误:
The app compiles and runs smoothly in Debug mode, however in Release mode I get the following error:
pcrecpp.lib(pcrecpp.obj) : error LNK2038: mismatch detected for
'_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in LoginDlg.obj
我应该从哪里开始检查?
Where should I start checking?
推荐答案
您的应用正在发布模式下进行编译,但是您链接的是PCRE的调试版本,该版本已设置/MTd(或类似设置),从而导致CRT中的迭代器调试级别不匹配.
Your app is being compiled in release mode, but you're linking against the debug version of PCRE, which had /MTd (or similar) set, thus causing the mismatch in iterator debugging level in the CRT.
在发布模式下重新编译PCRE以匹配您自己的应用程序.
Recompile PCRE in release mode to match your own application.
VS 2010中的 detect_mismatch
pragma 是导致此问题的原因发出错误.
The detect_mismatch
pragma in VS 2010 is what causes this error to be emitted.
请参见 http://blogs.msdn .com/b/vcblog/archive/2009/06/23/stl-performance.aspx (搜索_ITERATOR_DEBUG_LEVEL)
See http://blogs.msdn.com/b/vcblog/archive/2009/06/23/stl-performance.aspx (search for _ITERATOR_DEBUG_LEVEL)
这篇关于链接器错误LNK2038:在发布模式下检测到不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!