Linker error LNK2038: mismatch detected in Release mode

青春壹個敷衍的年華 提交于 2019-12-02 21:44:15

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.

Recompile PCRE in release mode to match your own application.

The detect_mismatch pragma in VS 2010 is what causes this error to be emitted.

See http://blogs.msdn.com/b/vcblog/archive/2009/06/23/stl-performance.aspx (search for _ITERATOR_DEBUG_LEVEL)

I had the same error. In my case the solution is easy: I had one project A depending on another project B. B had a preprocessor definition _DEBUG in debug mode and A didn't.

Just add _DEBUG to project A(project->properties->c++->preprocessor->preprocessor definitions) and you're done.

My problem was that dependent project used "Use Multi-Byte Character Set"
under Generl-->Character set. while other project had "No Set" value

Art

This can also be caused by setting the preprocessor definition _HAS_ITERATOR_DEBUGGING=0 in project B and not in A where A produces a lib used by B.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!