error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj

前端 未结 20 1027
耶瑟儿~
耶瑟儿~ 2020-11-29 20:36

I have read a lot of solutions to my problem but none helped. I tried clean, rebuild. Reinstalled visual 2010 and change from professional to ultimate. But still I dont know

相关标签:
20条回答
  • 2020-11-29 21:05

    I resolved my trouble in correcting the "Additional Library Directory", this one was wrong in indicating "$(SolutionDir)\Release", I changed it in "$(SolutionDir)\$(IntDir)"

    To correct it, open your project properties -> Configuration Properties -> Linker -> General -> Additional Library Directory

    I hope this will help some poeples with the same trouble ;)

    0 讨论(0)
  • 2020-11-29 21:08

    Try change _DEBUG to NDEBUG macro definition in C++ project properties (for Release configuration) Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions

    0 讨论(0)
  • 2020-11-29 21:09

    opencv_core245.lib(dxt.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in test.obj I got error like this.
    I have opencv_core245.lib and opencv_core245d.lib in Linker->Input->Additional dependenc. Since this two were confilicting I removed first one opencv_core245.lib. Error gone.

    0 讨论(0)
  • 2020-11-29 21:10

    The error can be caused by mixing together debug builds and release builds in same executable or dll.

    1. in the vs configuration manager, are some of your projects in debug mode and some in release mode?
    2. is one of your release projects has the preprocessor symbol DEBUG or _DEBUG defined?
    3. is one of your debug projects has the preprocessor symbol NDEBUG defined?
    0 讨论(0)
  • 2020-11-29 21:10

    I had the same issue between debug and release libraries. The mistake was in the solution properties / Configurations properties / Configurations.

    The projects configurations did not match the main configuration / platform.

    0 讨论(0)
  • 2020-11-29 21:12

    I managed to get rid of this error (in my case using Ogre3D + Bullet) by changing the dependency libraries to the debug versions in Project Properties -> Linker -> Input -> Additional Dependencies (VC10).

    I changed BulletCollision.lib to BulletCollision_debug.lib (for debug configuration) and it compiled.

    0 讨论(0)
提交回复
热议问题