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

前端 未结 20 1102
耶瑟儿~
耶瑟儿~ 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:29

    If you would like to purposely link your project A in Release against another project B in Debug, say to keep the overall performance benefits of your application while debugging, then you will likely hit this error. You can fix this by temporarily modifying the preprocessor flags of project B to disable iterator debugging (and make it match project A):

    In Project B's "Debug" properties, Configuration Properties -> C/C++ -> Preprocessor, add the following to Preprocessor Definitions:

    _HAS_ITERATOR_DEBUGGING=0;_ITERATOR_DEBUG_LEVEL=0;

    Rebuild project B in Debug, then build project A in Release and it should link correctly.

提交回复
热议问题