使用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