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 中添加环境变量哦。
如下:
别忘了把用户名换成你自己的: )
测试:
进入ns-allinone-2.33/xgraph-12.1/examples目录下
敲:
xgraph bar.xg
你会看到如下形:
success
enjoy it!