gdb调试中出现No symbol table is loaded. Use the "file" command.问题

在unix/linux系统下使用gdb进行调试时,如果出现:

No symbol table is loaded. Use the "file" command.

原因是没有在Makefile中添加-g调试参数,或者添加位置出错,解决的办法是在Makefile文件的第一行加上:

CFLAGS = -g

然后重新make即可。

原文地址:https://www.cnblogs.com/sophia-yun/p/3248798.html