How to debug release mode program in visual studio

一般情况下,因为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

原文地址:https://www.cnblogs.com/ericsun/p/2588223.html