Ubuntu 7.10下安装NS2的曲折经历

NS2是一个功能强大的网络模拟工具,下面介绍一下我在Ubuntu 7.10系统下安装NS2所遇到的艰难险阻,给后来者以借鉴。

问题一:刚开始安装时显示gcc can't create executables之类的提示

解决方案:
这是由于我用的是ubuntu免费邮寄的安装盘,安装后的系统中gcc是不能用来的开发的,只有一个空壳,所以需要重新安装gcc。先用命令: sudo apt-get remove gcc
然后sudo apt -get install build-essential 便成功解决问题。

问题二:再次安装NS2时发现安装至tk8.4.13时出现错误,安装中断退出。在安装日志上发现一句:x11/xlib.h nosuch file or directory 在网上查阅了资料,原来是x11M没有装。

解决方案:
先安装X11,命令为 sudo apt -get install libx11-dev
结果仍然出错如下:
checking for main in -lXbsd... no
checking for socket in -lsocket... no
checking for gethostbyname in -lnsl... yes
checking for dcgettext in -lintl... no
checking for getnodebyname in -ldnet_stub... no
checking that g++ can handle -O2... no
checking standard STL is available... no
checking for tcl.h... -I../include
checking for tclInt.h... -I../include
checking for libtcl8.4... -L../lib -ltcl8.4
checking for init.tcl... ../lib/tcl8.4
checking for http.tcl... ../lib/tcl8.4/http1.0
checking Tcl http.tcl library... yes
checking for tclsh8.4.11... no
checking for tclsh8.4... ../bin/tclsh8.4
checking for tk.h... -I../include
checking for libtk8.4... -L../lib -ltk8.4
checking for tk.tcl... ../lib/tk8.4
checking for X11 header files
can't find X includes
otcl-1.12 configuration failed! Exiting ...
Please check
for common problems and bug fixes.
还是没有得到解决.分析了一下可能是x11没有安装完整,于是先输入:sudo apt-cache search x11-dev
得到以下信息:
libx11-dev - X11 client-side library (development headers)
xlibs-dev - X Window System client library development files transitional package
libghc6-x11-dev - Haskell X11 binding for GHC
libooc-x11-dev - X11 specific modules for the oo2c compiler (devel)
libgl1-mesa-swx11-dev - A free implementation of the OpenGL API -- development support files
分别安装上面的组件,命令如下:
sudo apt-get install libx11-dev
sudo apt-get install xlibs-dev
sudo apt-get install libghc6-x11-dev
sudo apt-get install libooc-x11-dev

然后继续安装,等了半天,安装完成!

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/2046d29b42bbe1070664a2efab77e379.html