如何修复 CodeBlocks 调试程序时显示错误

原创
如何修复 CodeBlocks 调试程序时显示错误

CodeBlocks 版本:17.12
平台:win10 1809 64bit

当你调试 Debug 的时候,CodeBlocks 的 Build messages 窗口可能会出现以下错误提示:

ERROR: You need to specify a debugger program in the debuggers's settings.
(For MinGW compilers, it's 'gdb.exe' (without the quotes))
(For MSVC compilers, it's 'cdb.exe' (without the quotes))

造成这个问题的原因是你没有配置好调试器,只需要按照以下步骤来修改调试器的设置,为调试器指定调试器程序。

  • 在 Code::Blocks IDE 的菜单栏中选择:Settings(设置) -> Debugger(调试)
  • 在弹出的窗口的左侧选择 Common -> GDB/CDB debugger -> Default.
  • 在右侧的 Executable path 中选择 gdb32.exe 的路径,默认的位置的是:C:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb32.exe 你需要根据自己的系统调整。
  • 最后点击 OK 保存退出即可正常开展 debug 工作啦。
替代文本

操作步骤

欢迎转载,但请勿用于任何商业用途,谢谢你!请标注以下信息『 原文出处:如何修复 CodeBlocks 调试程序时显示错误 - 张林海博客 http://zhanglinhai.com/archives/1395 』