使用gdb调试程序时提示No symbol table is loaded. Use the "file" command.

时间:2018-06-30 21:13:02   收藏:0   阅读:506

这是因为编译.o文件时没有一起生成调试信息,应该在makefile中的编译命令中制定-g参数,如下:

  1 sort:main.o bubble.o

  2     gcc -o sort main.o bubble.o

  3 

  4 main.o:main.c bubble.h

  5     gcc -g -c main.c

  6 

  7 pubble.o:bubble.c

  8     gcc -g -c bubble.c

  9 

 10 clean:

 11     rm sort main.o bubble.o

原文:https://www.cnblogs.com/skxabc/p/9248617.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!