Ubuntu 12.04 LTS安装ns-2.34过程中出现的错误及其解决方案

来源:互联网 发布:java项目进度表怎么写 编辑:程序博客网 时间:2024/05/20 22:28

1、错误提示:can't find X Includes

解决办法:
sudo apt-cache search x11-dev
会输出下面都结果
libgl1-mesa-swx11-dev - free implementation of the OpenGL API -- development files
libx11-dev - X11 client-side library (development headers)
libghc-x11-dev - Haskell X11 binding for GHC
libghc6-x11-dev - transitional dummy package
然后把这几个包都安装,即
sudo apt-fast install libx11-dev
sudo apt-fast install libgl1-mesa-swx11-dev
sudo apt-fast install libghc-x11-dev
sudo apt-fast install libghc6-x11-dev

2、错误提示:ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined

解决办法: 进入otcl-1.13目录,找到configure.in,
将77行,
SHLIB_LD="ld -shared"
改为
SHLIB_LD="gcc -shared"
同时修改configure 第6304行(可能行数会有差别,自己在文档里搜一下)
SHLIB_LD="ld -shared"
改为
SHLIB_LD="gcc -shared"

3、错误提示:expected primary-expression before ‘struct’

mac/mac-802_11Ext.h: In member function ‘u_int32_t PHY_MIBExt::getHdrLen11()’:
mac/mac-802_11Ext.h:176:19: error: expected primary-expression before ‘struct’
mac/mac-802_11Ext.h:176:41: error: ‘dh_body’ was not declared in this scope
mac/mac-802_11Ext.h:176:51: error: ‘offsetof’ was not declared in this scope
解决方案:在ns-allinone-2.34\ns-2.34\mac\mac-802_11Ext.h 文件中添加#include <cstddef>

4、错误提示:不能直接调用构造函数‘GammaRandomVariable::GammaRandomVariable’

tools/ranvar.cc: 在成员函数‘virtual double GammaRandomVariable::value()’中:
tools/ranvar.cc:219:70: 错误:不能直接调用构造函数‘GammaRandomVariable::GammaRandomVariable’
tools/ranvar.cc:219:70: 错误:对于函数类型的类型转换,移除冗余的‘::GammaRandomVariable’

mobile/nakagami.cc: 在成员函数‘virtual double Nakagami::Pr(PacketStamp*, PacketStamp*, WirelessPhy*)’中:
mobile/nakagami.cc:183:73: 错误:不能直接调用构造函数‘ErlangRandomVariable::ErlangRandomVariable’
mobile/nakagami.cc:183:73: 错误:对于函数类型的类型转换,移除冗余的‘::ErlangRandomVariable’
mobile/nakagami.cc:185:67: 错误:不能直接调用构造函数‘GammaRandomVariable::GammaRandomVariable’
mobile/nakagami.cc:185:67: 错误:对于函数类型的类型转换,移除冗余的‘::GammaRandomVariable’
解决办法:当相应的文件中定位到错误行,把::GammaRandomVariable和::ErlangRandomVariable删除


5、错误提示:ns: finish: couldn't execute "nam": no such file or directory

Ubuntu未安装nam,测试tcl/ex/simple.tcl的时候会提示错误
所以还要装nam
#sudo apt-fast install libxmu-dev nam
安装完后就可以显示动态画面了
0 0