为 VC6 程序 Release 版本增加调试信息的具体操作方式如下:
1、菜单 Build -> Configuration...,点击 Add 按钮,从 Release 版本复制一个编译选项,命名为“Release with debug info”,当然名称随意。
2、菜单 Project -> Settings...,在左上角选中刚才创建的“Release with debug info”,然后修改以下内容:
a、C++ | Category: General:Optimizations 设置为“Disable (debug)”;选中“Generate browse info”;Debug Info 设置为“Program Database”。
b、Link | Category: General:选中“Generate debug info”。
3、菜单 Build -> Set Active Configuration...,选中“Release with debug info”。
经过以上配置之后,编译,即可得到“带调试信息的Release程序”,可设置程序断点,可跟踪调试。这种版本程序既有 Debug 的一面,又有 Release 的一面,当然更多的倾向于 Release。
调试完毕并解决问题之后,再编译出 Release 版本(Set Active Configuration)发布给最终用户。
OK!!s