_DEBUG预处理器定义问题
release状态编译了一个dll,但运行报assert错误,看了下系统库的源码,是在"#if defined _DEBUG"条件编译下的代码报出来的,疑惑release为什么还有_DEBUG状态,搜了代码、查看了预处理器定义都是没有的。
后询问了大佬,原来如此:
查看微软官方说明,确实:
The compiler defines _DEBUG when you specify the /MTd or /Mdd option. These options specify debug versions of the C runtime library.
参考链接:https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa246791(v=vs.60)?redirectedfrom=MSDN
本文为原创,转载请注明:https://www.cnblogs.com/zhanglb163/