歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 7.10下安裝NS2的曲折經歷

Ubuntu 7.10下安裝NS2的曲折經歷

日期:2017/2/28 16:59:50   编辑:Linux教程

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 http://www.isi.edu/nsnam/ns/ns-problems.html
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

然後繼續安裝,等了半天,安裝完成!

Copyright © Linux教程網 All Rights Reserved