_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

 


当您指定/MTd或/Mdd选项时,编译器将定义_DEBUG。这些选项指定C运行时库的调试版本。The results showed that there was no significant difference between the two groups(P> 0.05).

后巽汶

B

posted @   Coderrrrrr  阅读(21)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
点击右上角即可分享
微信分享提示