Daily Archives: March 31, 2018

MSVC debug build

在VC++的設定: C/C++若有定義_DEBUG 則需注意link應該link MTd or MDd 因為有些function 如_free_dbg是在定義_DEBUG時會被編譯(參考<crtdbg.h>) 此時如果link到release版的MT or MD,則會出現unresolved link 另外,這個錯誤訊息也是因為_DEBUG混用造成的 error LNK2038: mismatch detected for ‘_ITERATOR_DEBUG_LEVEL’: value ‘0’ doesn’t match value ‘2’ in … 在<yvals.h≶(一些c++ std header會間接引用) #ifdef _DEBUG #define _HAS_ITERATOR_DEBUGGING 1 #else #define _HAS_ITERATOR_DEBUGGING 0 #endif … Continue reading

Posted in Tips | Leave a comment