Dev C++ 工程没有调试信息 解决办法

Dev C++ 工程没有调试信息 解决方法
DevC++4.9.9.2中,按 F8 开始调试。提示信息为:工程没有调试信息,您想打开工程的调试选项并重新生成吗?选择是后,再按F8,仍旧是这个信息。什么原因呢?

按照帮助,Frequently Asked Questions (FAQ)中提示
How do i enable Debugging mode 

Go to Compiler Options and click on the Compiler sheet. In the Linker section, put projectes to 'Generate debugging information'. Do a 'Rebuild All' and you should be able to debug now.
tools->compiler option->settings->linker里设置为yes后,Generate debugging information,并且Rebuild All了。还是不行,但是,经试验发现,系统提供的例子程序却能调试,没办法,只好比较一下编译信息,发现,自己建立的工程在编译的时候,没有加-g选项,在gdb的帮助里说到,要想使用gdb调试,必须加上这个参数(因为Dev C++使用的是gdb调试器),在仔细查找,发现在工程文件夹里有一个Makefile.win的文件,打开一个,是一个Makefile文件,因此,就得从刚才compiler option选项里配置,经过试验,有四处需要变化:

1、在“工具”-》编译选项-》"Add following commands when calling complier"下面的编辑框里加上:-g3
2、在下面的"Add these commands to the linker command line" 下的编辑框上加上:-g3

3、转到programs页,把gcc行修改为:gcc.exe -D__DEBUG__

4、把g++行修改为g++.exe -D__DEBUG__ ,点击ok。
重新编译,就能调试了。

posted @ 2014-08-31 11:58  史红星-shihongxing  阅读(2271)  评论(0编辑  收藏  举报