`

[NS2] Segmentation fault 错误

阅读更多

为了找到错误所在,修改 Makefile 在
*/ns*-allinone/ns*/ folder下

1. locate the compiler command it will either be "cc" or "gcc". change
it to "cc -g" or "gcc -g". This will make the compiler generated flags
for gdb
2. Then type
       >make clean
       >make
   this will re compile ns
3. then run ns using gdb using the command below
      >gdb ns
      >[inside gdb]r your-tcl-file.tcl
4. Then, when you get a seg fault , it will show you the line number
and file name which caused the Seg Fault . This will give you lot of
info to debug your code.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics