fedora 下ns2安装完后提示没有xgraph的解决办法

Xgraph is not considered important, that's why " ./install "
just ignores it by errors. ( xgraph files = 9 years old.)
It may be possible to compile it, by using the Ubuntu patch ?
http://packages.ubuntu.com/karmic/xgraph 
[xgraph_12.1-11.diff.gz]

But much easier is :

sudo apt-get install xgraph ygraph

'ygraph' is a modern, more advanced tool .. 
http://packages.ubuntu.com/karmic/ygraph 
.....

==================== 上面的是ubuntu下的解决办法

 

问题是在fedora 下使用yum install xgraph不能找到xgraph的安装包

解决办法:

进入未编译的ns-allinone-2.33/xgraph-12.1目录下

敲./configrue

接着make

但是出现如下错误;

--------------------------------------------------------------------------

[root@cj xgraph-12.1]# make
gcc -DHAVE_CONFIG_H -I. -I. -I.        -g    -c xgraph.c
gcc -DHAVE_CONFIG_H -I. -I. -I.        -g    -c xgX.c
gcc -DHAVE_CONFIG_H -I. -I. -I.        -g    -c hard_devices.c
gcc -DHAVE_CONFIG_H -I. -I. -I.        -g    -c dialog.c
dialog.c: 在函数‘make_msg_box’中:
dialog.c:780: 警告:传递‘getline’的第 2 个参数时在不兼容的指针类型间转换
/usr/include/stdio.h:653: 附注:需要类型‘size_t * __restrict__’,但实参的类型为‘char *’
dialog.c:780: 错误:提供给函数‘getline’的实参太少
dialog.c: 在函数‘getline’中:
dialog.c:899: 错误:实参‘lptr’与原型不符
/usr/include/stdio.h:653: 错误:原型声明
dialog.c:899: 错误:实参数目与原型不符
/usr/include/stdio.h:653: 错误:原型声明
make: *** [dialog.o] 错误 1

----------------------------------------------------------------------

原因:

The standard lib (stdio.h) function getline has been redefined in <installdir>/ns-allinone-2.31/xgraph-12.1/dialog.c. Quick fix: Edit the file and change the two references to getline to something else, e.g. getmyline. Then the program builds...

就是说,把dialog.c中的 所有geline替换成getmyline

接着make.

make完后

make install

别忘了在.bashrc 中添加环境变量哦。

如下:

[xhtml]  view plain copy print ?
  1. OTCL_LIB=/home/cj/ns-allinone-2.33/otcl-1.13  
  2. NS2_LIB=/home/cj/ns-allinone-2.33/lib  
  3. X11_LIB=/usr/X11R6/lib  
  4. USR_LOCAL_LIB=/usr/local/lib  
  5. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB  
  6. #TCL_LIBRARY                                                                                                                                  
  7. TCL_LIB=/home/cj/ns-allinone-2.33/tcl8.4.18/library  
  8. USR_LIB=/usr/lib  
  9. export TCL_LIBRARY=$TCL_LIB:$USR_LIB  
  10. #PATH  
  11. XGRAPH=/home/cj/ns-allinone-2.33/bin:/home/cj/ns-allinone-2.33/tcl8.4.18/unix:/home/cj/ns-allinone-2.33/tk8.4.18/unix  
  12. NS=/home/cj/ns-allinone-2.33/ns-2.33  
  13. TCL=/home/cj/ns-allinone-2.33/tcl8.4.18/library  
  14. NS_=/usr/local/bin  
  15. PATH=$PATH:$XGRAPH:$NAM:$TCL_:NS_  
  16. #fin pour NS2   

别忘了把用户名换成你自己的: )

测试:

进入ns-allinone-2.33/xgraph-12.1/examples目录下

敲:

xgraph bar.xg

你会看到如下形:

 

success

  enjoy it!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值