NS安装问题集锦
来源:互联网 发布:c#windows图片查看器 编辑:程序博客网 时间:2024/04/28 10:13
转自http://blog.csdn.net/windows00/archive/2009/12/08/4967801.aspx
个人觉得写得不错,希望能给大家带来帮助
初次安装NS2可能会遇到一些问题。为了顺利安装,在这篇文章中,我叙述了在安装NS2的过程中所遇到的问题,以及解决这些问题的办法。
描述
- 虚拟机环境:VirtualBox 3.1.0 r55467
- 操作系统:ubuntu-9.10-desktop-i386.iso
- NS2版本:The Network Simulator - ns-2 (ns-allinone-2.34)
问题1
在安装NS2的过程中,可能会出现如下的错误信息:
- eneric/tk3d.c:242: error: ‘None’ undeclared (first use in this function)
- /media/Software/Quyettong/linux/soflware/ns2/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:243: error: ‘
- TkBorder’ has no member named ‘bgGC’
- /media/Software/Quyettong/linux/soflware/ns2/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:244: error: ‘
- TkBorder’ has no member named ‘darkGC’
- /media/Software/Quyettong/linux/soflware/ns2/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:245: error: ‘
- TkBorder’ has no member named ‘lightGC’
- /media/Software/Quyettong/linux/soflware/ns2/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:246: error: ‘
- TkBorder’ has no member named ‘hashPtr’
- ...........................................
- ...........................................
- eneric/tk3d.c:1400: error: ‘TkBorder’ has no member named ‘nextPtr’
- /media/Software/Quyettong/linux/soflware/ns2/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:1403: error:
- ‘TkBorder’ has no member named ‘resourceRefCount’
- /media/Software/Quyettong/linux/soflware/ns2/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:1405: error:
- ‘TkBorder’ has no member named ‘objRefCount’
- make: *** [tk3d.o] Error 1
- tk8.4.18 make failed! Exiting ...
eneric/tk3d.c:242: error: ‘None’ undeclared (first use in this function)/media/Software/Quyettong/linux/soflware/ns2/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:243: error: ‘TkBorder’ has no member named ‘bgGC’/media/Software/Quyettong/linux/soflware/ns2/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:244: error: ‘TkBorder’ has no member named ‘darkGC’/media/Software/Quyettong/linux/soflware/ns2/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:245: error: ‘TkBorder’ has no member named ‘lightGC’/media/Software/Quyettong/linux/soflware/ns2/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:246: error: ‘TkBorder’ has no member named ‘hashPtr’......................................................................................eneric/tk3d.c:1400: error: ‘TkBorder’ has no member named ‘nextPtr’/media/Software/Quyettong/linux/soflware/ns2/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:1403: error: ‘TkBorder’ has no member named ‘resourceRefCount’/media/Software/Quyettong/linux/soflware/ns2/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:1405: error: ‘TkBorder’ has no member named ‘objRefCount’make: *** [tk3d.o] Error 1tk8.4.18 make failed! Exiting ...
原因
The required packages are :
- libx11-dev , libxmu-dev , libxmu-headers , libxt-dev , libtool
libx11-dev , libxmu-dev , libxmu-headers , libxt-dev , libtool
参考:http://www.linuxquestions.org/questions/linux-newbie-8/ns-allinone-on-ubuntu-offline-765055/
解决方法
依次更新或者安装以上的程序包。完成后,执行"./install"
问题2
上面的问题解决好以后,可能会出现如下错误信息:
- No .configure file found in current directory
- Continuing with default options...
- checking build system type... i686-pc-linux-gnu
- checking host system type... i686-pc-linux-gnu
- checking target system type... i686-pc-linux-gnu
- checking for gcc... gcc
- checking for C compiler default output file name... a.out
- checking whether the C compiler works... yes
- checking whether we are cross compiling... no
- checking for suffix of executables...
- checking for suffix of object files... o
- checking whether we are using the GNU C compiler... yes
- checking whether gcc accepts -g... yes
- checking for gcc option to accept ISO C89... none needed
- checking for g++... g++
- checking whether we are using the GNU C++ compiler... yes
- checking whether g++ accepts -g... yes
- checking how to run the C preprocessor... gcc -E
- checking for grep that handles long lines and -e... /bin/grep
- checking for egrep... /bin/grep -E
- checking for ANSI C header files... yes
- checking for sys/types.h... yes
- checking for sys/stat.h... yes
- checking for stdlib.h... yes
- checking for string.h... yes
- checking for memory.h... yes
- checking for strings.h... yes
- checking for inttypes.h... yes
- checking for stdint.h... yes
- checking for unistd.h... yes
- checking for string.h... (cached) yes
- 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.18... 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
- checking for X11 library archive
- checking for XOpenDisplay in -lX11... yes
- checking for XShmAttach in -lXext... yes
- checking for ranlib... ranlib
- checking for a BSD-compatible install... /usr/bin/install -c
- checking system version (for dynamic loading)... Linux-2.6.31-14-generic
- No explicit static compilation flag; setting V_STATIC to ""
- checking for dlopen in -ldl... yes
- checking for a BSD-compatible install... /usr/bin/install -c
- configure: creating ./config.status
- config.status: creating Makefile
- rm -f libotcl.so otcl.o so_locations
- gcc -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/home/pengyicun/桌面/ns-allinone-2.34/include -
- I/home/pengyicun/桌面/ns-allinone-2.34/include -I/home/pengyicun/桌面/ns-allinone-2.34/include -I/include
- otcl.c
- ld -shared -o libotcl.so otcl.o
- otcl.o: In function `OTclDispatch':
- /home/pengyicun/桌面/ns-allinone-2.34/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local'
- otcl.o: In function `Otcl_Init':
- /home/pengyicun/桌面/ns-allinone-2.34/otcl-1.13/otcl.c:2284: undefined reference to `__stack_chk_fail_local'
- ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
- ld: final link failed: Nonrepresentable section on output
- make: *** [libotcl.so] Error 1
- otcl-1.13 make failed! Exiting ...
No .configure file found in current directoryContinuing with default options...checking build system type... i686-pc-linux-gnuchecking host system type... i686-pc-linux-gnuchecking target system type... i686-pc-linux-gnuchecking for gcc... gccchecking for C compiler default output file name... a.outchecking whether the C compiler works... yeschecking whether we are cross compiling... nochecking for suffix of executables... checking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether gcc accepts -g... yeschecking for gcc option to accept ISO C89... none neededchecking for g++... g++checking whether we are using the GNU C++ compiler... yeschecking whether g++ accepts -g... yeschecking how to run the C preprocessor... gcc -Echecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking for string.h... (cached) yeschecking for main in -lXbsd... nochecking for socket in -lsocket... nochecking for gethostbyname in -lnsl... yeschecking for dcgettext in -lintl... nochecking for getnodebyname in -ldnet_stub... nochecking that g++ can handle -O2... nochecking standard STL is available... nochecking for tcl.h... -I../includechecking for tclInt.h... -I../includechecking for libtcl8.4... -L../lib -ltcl8.4checking for init.tcl... ../lib/tcl8.4checking for http.tcl... ../lib/tcl8.4/http1.0checking Tcl http.tcl library... yeschecking for tclsh8.4.18... nochecking for tclsh8.4... ../bin/tclsh8.4checking for tk.h... -I../includechecking for libtk8.4... -L../lib -ltk8.4checking for tk.tcl... ../lib/tk8.4checking for X11 header fileschecking for X11 library archivechecking for XOpenDisplay in -lX11... yeschecking for XShmAttach in -lXext... yeschecking for ranlib... ranlibchecking for a BSD-compatible install... /usr/bin/install -cchecking system version (for dynamic loading)... Linux-2.6.31-14-genericNo explicit static compilation flag; setting V_STATIC to ""checking for dlopen in -ldl... yeschecking for a BSD-compatible install... /usr/bin/install -cconfigure: creating ./config.statusconfig.status: creating Makefilerm -f libotcl.so otcl.o so_locationsgcc -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/home/pengyicun/桌面/ns-allinone-2.34/include -I/home/pengyicun/桌面/ns-allinone-2.34/include -I/home/pengyicun/桌面/ns-allinone-2.34/include -I/include otcl.cld -shared -o libotcl.so otcl.ootcl.o: In function `OTclDispatch':/home/pengyicun/桌面/ns-allinone-2.34/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local'otcl.o: In function `Otcl_Init':/home/pengyicun/桌面/ns-allinone-2.34/otcl-1.13/otcl.c:2284: undefined reference to `__stack_chk_fail_local'ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't definedld: final link failed: Nonrepresentable section on outputmake: *** [libotcl.so] Error 1otcl-1.13 make failed! Exiting ...
原因
gcc 4.0版本以前是用"ld -share"来生成共享库的,但是到了4.0以上的版本(我的为gcc version 4.4.1),这个命令改为"gcc -share"即可
解决方法
把ns-allinone-2.33/otcl-1.13文件夹下的configure.in及configure中的"ld -shared"替换成"gcc -shared",并保存。回到ns-allinone-2.33/目录重新运行"./install"
参考:http://blog.sina.com.cn/s/blog_4d1bbec70100gkjh.html
最后结果
安装过程时间持续比较长(大约20min),需要耐心等待,如果正确安装会出现如下信息:
- Ns-allinone package has been installed successfully.
- Here are the installation places:
- tcl8.4.18: /home/pengyicun/桌面/ns-allinone-2.34/{bin,include,lib}
- tk8.4.18: /home/pengyicun/桌面/ns-allinone-2.34/{bin,include,lib}
- otcl: /home/pengyicun/桌面/ns-allinone-2.34/otcl-1.13
- tclcl: /home/pengyicun/桌面/ns-allinone-2.34/tclcl-1.19
- ns: /home/pengyicun/桌面/ns-allinone-2.34/ns-2.34/ns
- nam: /home/pengyicun/桌面/ns-allinone-2.34/nam-1.14/nam
- gt-itm: /home/pengyicun/桌面/ns-allinone-2.34/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns
- ----------------------------------------------------------------------------------
- Please put /home/pengyicun/桌面/ns-allinone-2.34/bin:/home/pengyicun/桌面/ns-allinone-
- 2.34/tcl8.4.18/unix:/home/pengyicun/桌面/ns-allinone-2.34/tk8.4.18/unix
- into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.
- IMPORTANT NOTICES:
- (1) You MUST put /home/pengyicun/桌面/ns-allinone-2.34/otcl-1.13, /home/pengyicun/桌面/ns-allinone-2.34/lib,
- into your LD_LIBRARY_PATH environment variable.
- If it complains about X libraries, add path to your X libraries
- into LD_LIBRARY_PATH.
- If you are using csh, you can set it like:
- setenv LD_LIBRARY_PATH <paths>
- If you are using sh, you can set it like:
- export LD_LIBRARY_PATH=<paths>
- (2) You MUST put /home/pengyicun/桌面/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental
- variable. Otherwise ns/nam will complain during startup.
- After these steps, you can now run the ns validation suite with
- cd ns-2.34; ./validate
- For trouble shooting, please first read ns problems page
- http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
- for related posts.
- NS安装问题集锦
- NS-2.27安装错误集锦
- ns-allinone-2.34 安装错误集锦
- 转:ns-allinone-2.27 安装错误集锦
- NS安装问题收集(2)
- NS安装问题收集(3)
- ns安装出现的问题
- NS安装
- kvm安装问题集锦
- PGI安装问题集锦
- exsi 安装问题集锦
- Scrapy 安装问题集锦
- PHP安装问题集锦
- ns修改.bashrc问题(winxp下安装多个NS版本)
- 安装cygwin+ns-2 过程中home路径问题
- Ubuntu安装NS-3方法和遇到的问题
- ns2 安装与问题集锦
- opencms8.5安装问题集锦
- Spring XML配置十二个最佳实践
- datable 绑定 matrix
- ubuntu 10.04源 更新源列表
- Ubuntu下MPlayer(万能播放器)的使用
- 解决Cross-thread operation not valid的问题-zz
- NS安装问题集锦
- 配置Oracle使用SQL操作st_geometry
- 【预告】CSDN TUP第四期:Hadoop技术沙龙——Hadoop应用性能优化实战
- 解惑 spring 嵌套事务
- 背叛
- 绑定控件事件
- c#提取数组中不同的元素
- Sbo存储过程
- ubuntu系统下virtualbox使用usb设备