Dev-c++在windows环境下无法debug(调试)的解决方案

  如标题所见,在官网上下载的最新版本的Dev-C++居然无法调试,这是何等烦人,有些时候我们为了更加了解一下代码中递归部分的变化情况,debug功能举足轻重。

在本人的windows环境下一debug(F5),dev-c++就立马跳出个程序遇到错误的提示,然后关闭程序,但是本人想了想:是不是本人代码功力太菜,是代码导致软件崩溃呢?最后尝试着写了个"Hello-World!",依然是在Debug中崩溃,经过查阅资料,给出以下解决方案:

1 在软件的tools选项->complie option页面做如下图片中的操作:(1)在Add the following commands when calling the compiler添加命令-g3 (2)在Add the following  command when calling the linker中添加-g3(注意-static-libgcc是本来就存在的命令);

2 在tools->compile option->settings->linker中将"Generate debugging information(-g3)"中将no改为yes,如下图

3 在tools->compile option->settings->progran中将"Generate debugging information(-g3)"中,(1)将gcc选项中的"gcc.exe"改为"gcc.exe -D_DEBUG_";(2)将g++选项中的"g++.exe"改为"g++.exe -D_DEBUG_",保存

注意:每一步都必须注意保存。

 

posted @ 2017-11-30 10:51  Go_now  阅读(13393)  评论(0编辑  收藏  举报