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


这是因为编译.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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM