帮助链接器错误LNK2038! [英] Help with Linker error LNK2038 !
问题描述
我尝试将一个小应用程序从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.
应用程序在调试模式下编译和运行,但是在发布模式下,我得到以下错误:
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
最糟糕的部分是,我不知道应该开始检查...
The worst part is that I don't know where I should start checking...
任何帮助将非常感激。
推荐答案
您的应用程序正在以发布模式编译,但您正在与具有/ MTd(或类似)集的调试版本的PCRE链接,导致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中的 detect_mismatch
pragma 2010是导致此错误发生的原因。
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!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!