How to debug release mode program in visual studio

叁歲伎倆 2022-03-29 06:08 342阅读 0赞

一般情况下,因为release模式的需求,在release模式下的程序是没有debug符号信息的,但是我们可以通过修改Visual studio中的选项来enable release模式的程序的debug

右键项目,选择属性

关闭如下优化选项:

配置属性->c/c++->常规->调试信息格式:改为”用于‘编辑并继续’的程序数据库(/ZI)“;

配置属性->c/c++->优化->优化:改为“已禁用(/Od)”;

配置属性->c/c++->优化->全程优化:改为”否“;

如编译遇到error D8016: ‘/ZI’ and ‘/Ob1’ command-line options are incompatible错误,按下列方式修改:

You need to chnage one of these settings.

/ZI is set by:

Project properties->Configuration Properties->C/C++->General->Debug Information Format

/Ob1 is set by:

Project properties->Configuration Properties->C/C++->Optimization->Inline Function Expansion

参考:http://blog.csdn.net/xy365/article/details/7480966

发表评论

表情:
评论列表 (有 0 条评论,342人围观)

还没有评论,来说两句吧...

相关阅读