在ubuntu 9.10下安装NS2 2.34时出错

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
lzg0179
帖子: 3
注册时间: 2009-11-05 8:47

在ubuntu 9.10下安装NS2 2.34时出错

#1

帖子 lzg0179 » 2009-11-05 8:56

config.status: creating Makefile
rm -f libotcl.so otcl.o so_locations
gcc -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/home/killer/ns-allinone-2.34/include -I/home/killer/ns-allinone-2.34/include -I/home/killer/ns-allinone-2.34/include -I/include otcl.c
ld -shared -o libotcl.so otcl.o
otcl.o: In function `OTclDispatch':
/home/killer/ns-allinone-2.34/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/killer/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] 错误 1
otcl-1.13 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
出错原因因该在这里面,我之前没装过NS2,对这也不是很懂,有没有谁懂在在ubuntu 9.10下安装NS2的方法也可以给我推荐下,是不是我操作系统版本太高了阿?
sunxch05
帖子: 15
注册时间: 2009-09-25 22:44

Re: 在ubuntu 9.10下安装NS2 2.34时出错

#2

帖子 sunxch05 » 2009-11-07 23:05

我也一样啊,无奈啊,求助!
天天学习,好好向上!
头像
goldfox_79
帖子: 2004
注册时间: 2005-10-16 8:26
来自: 地球

Re: 在ubuntu 9.10下安装NS2 2.34时出错

#3

帖子 goldfox_79 » 2009-11-07 23:46

google一下正好有人提到了9.10下安装ns遇到的问题,错误消息跟你的一样。转贴过来

原帖:http://nsnam.isi.edu/nsnam/index.php/User_Information
For Ubuntu 9.10 (karmic), you may encounter this error in the linking of otcl:

otcl.o: In function `OTclDispatch':
/home/ns/ns-allinone-2.34/otcl/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/ns/ns-allinone-2.34/otcl/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

This error is because the linker being used is "ld -shared" instead of "gcc -shared". If you edit one line in otcl-1.13/configure, and rerun install, it should work:

--- configure.orig 2009-11-02 12:14:52.556167945 -0800
+++ configure 2009-11-02 12:17:28.966706099 -0800
@@ -6301,7 +6301,7 @@
;;
Linux*)
SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld -shared"
+ SHLIB_LD="gcc -shared"
SHLIB_SUFFIX=".so"
DL_LIBS="-ldl"
SHLD_FLAGS=""

This will be fixed in future revisions of ns-2.
:em09
sunxch05
帖子: 15
注册时间: 2009-09-25 22:44

Re: 在ubuntu 9.10下安装NS2 2.34时出错

#4

帖子 sunxch05 » 2009-11-08 10:28

解决了,谢谢!
天天学习,好好向上!
sunxch05
帖子: 15
注册时间: 2009-09-25 22:44

Re: 在ubuntu 9.10下安装NS2 2.34时出错

#5

帖子 sunxch05 » 2009-11-08 10:32

goldfox_79, 谢谢!
天天学习,好好向上!
zjingle
帖子: 1
注册时间: 2009-12-07 21:26

Re: 在ubuntu 9.10下安装NS2 2.34时出错

#6

帖子 zjingle » 2010-01-12 16:31

我安装ns-2的过程,供大家参考:
1。系统ubuntu 9。10,下载ns-allinone-2.34
2。首先安装常用的包glibc,Xlibs-dev,libx11-dev,libxmu-dev,libxmu-headers,libgss-dev,libgss,g++,build-essentia等
3。更改在文件 otcl-1.13/configure的配置
inux*)
SHLIB_CFLAGS="-fpic"
SHLIB_LD="gcc -shared"
4。 ./install, 自动安装,大概5,6分钟
5。安装完后,把ns-allinone-2.34/otcl-1.13和ns-allinone-2.34/lib加入到共享库LD_LIBRARY_PATH,
把ns-allinone-2.34/tcl8.4.18/library加入到 TCL_LIBRARY

6。测试安装成功否
$cd ns-2.34;
$./validate
或者直接用hello world
$ns
%puts "hello world"
hello world
%
yiwan6
帖子: 59
注册时间: 2010-05-15 13:24

Re: 在ubuntu 9.10下安装NS2 2.34时出错

#7

帖子 yiwan6 » 2011-04-06 20:08

感谢goldfox_79
我在ubuntu10.04中安装ns-2.34
修改otcl-1.13/configure
安装成功
自己动手,丰衣足食!
回复