I am on my way

导航

关于NS2安装时的问题总结汇总

今天装ns,遇到一些问题,然后上网搜集了一些资料,放在这做个汇总,希望对自己和大家都有帮助。

转自http://prolqspace.spaces.live.com/blog/cns!7240DE3B63F5B841!878.entry

1、首先要做的事情:
为了防止出现“不匹配的括号”之类的问题,把以下文件中的.relid'`替换成.relid`:

    ns-allinone-2.27/tcl8.4.5/unix/configure
    ns-allinone-2.27/tcl8.4.5/unix/tcl.m4
    ns-allinone-2.27/tk8.4.5/unix/configure
    ns-allinone-2.27/tk8.4.5/unix/tcl.m4
    ns-allinone-2.27/otcl-1.8/configure

2、问题日志:
    ore -I./asim/ -I./qs -I./diffserv -I./satellite -I./wpan -o
    trace/trace.o
    trace/trace.cc
    ./sctp/sctp.h:705: error: extra qualification
    'SctpAgent::' on member
    'DumpSendBuffer'
    make: *** [trace/trace.o]
    Error 1

解决 办法:
    将文件sctp.h里面第705行DumpSendBuffer函数前面的'SctpAgent::'去掉。

3、问题日志:
    ./mobile/god.h:88: 错误:有多余的限定 ‘vector::’ 在成员 ‘operator=’ 上
    ./mobile/god.h:93: 错误:有多余的限定 ‘vector::’ 在成员 ‘operator+=’ 上
    ./mobile/god.h:98: 错误:有多余的限定 ‘vector::’ 在成员 ‘operator==’ 上
    ./mobile/god.h:101: 错误:有多余的限定 ‘vector::’ 在成员 ‘operator!=’ 上
    make: *** [src_rtg/sragent.o] 错误 1
    Ns make failed!
    See
    ::URL::http://www.isi.edu/nsnam/ns/ns-problems.html for problems

解决办法:
    分别将这些文件里面的‘vector::'去掉。

4、问题日志:

  queue/cbq.cc:112: error: ISO C++ forbids declaration of 'CBQueue' with no type

  用如下补丁(@@...@@之间表示行列号,+表示应增加的行,-表示应删除的行,其他表示原文。下同)
   @@ -87,6 +87,8 @@
   #define LEAF_LEVEL 1 /* level# for leaves */
   #define POWEROFTWO 16

   +class class CBQueue;
   +

   class CBQClass : public Connector {
   public:
   friend class CBQueue;

5、问题日志:

    tora_neighbor.h出如下错:
   ./tora/tora_neighbor.h:72: error: ISO C++ forbids declaration of ‘toraAgent’ with no type
   ./tora/tora_neighbor.h:72: error: expected ‘;’ before ‘*’ token
   make: *** [tora/tora.o] Error 1

  用如下补丁:
   @@ -41,6 +41,8 @@
   #ifndef __tora_neighbor_h__
   #define __tora_neighbor_h__

   +class toraAgent;
   +

   enum LinkStatus {
   LINK_UP = 0x0001, // upstream
   LINK_DN = 0x0002, // downstream

6、问题日志:

    diffusion3/ns/diffagent.cc出错,
    ./diffusion3/diffusion/diffusion.hh:97: error: expected `)' before '*' token

    用如下补丁
   @@ -99,6 +99,7 @@
   class DiffusionCoreAgent;
   class HashEntry;
   class NeighborEntry;

   +class DiffRoutingAgent;

   typedef list NeighborList;
   typedef list HashList;

7、问题日志:
    ore -I./asim/ -I./qs -I./diffserv -I./satellite -I./wpan -o 
    trace/trace.o
    trace/trace.cc
    ./sctp/sctp.h:705: error: extra qualification 
        'SctpAgent::' on member
        'DumpSendBuffer'
    make: *** [trace/trace.o] 
    Error 1
解决办法:   
      将文件sctp.h里面第705行DumpSendBuffer函数前面的'SctpAgent::'去掉。


8、问题日志:
    checking system version (for dynamic loading)... ./configure: line 7624:
    syntax error near unexpected token `)'./configure: line 7624: `OSF*)'
    tcl8.3.2 configuration failed! Exiting ...
    Tcl is not part of the 
    ns project.  Please see
    www.Scriptics.com<::URL::http://www.scriptics.com/> to see 
    if they have a fix for your platform.
解决办法:
    (1)分别进入以下目录:
        tcl8.x.x/unix/tcl.m4,
        tk8.x.x/unix/tcl.m4,
        otcl-1.x/configure.in.
    将这些文件里的
        system=MP-RAS-`awk ' { print $3 } '/etc/.relid'`
    改为:
        system=MP-RAS-`awk ' { print $3 } '/etc/.relid`

    (2)分别在
    tcl8.x.x/unix/
    tk8.x.x/unix/
    otcl-1.x/
    目录下运行
    antoconf(直接输入运行,输入第一回会出错,再输入一遍就没问题了)。

9、问题日志:
      ./mobile/god.h:88: 错误:有多余的限定 ‘vector::’ 在成员 ‘operator=’ 上
      ./mobile/god.h:93: 错误:有多余的限定 ‘vector::’ 在成员 ‘operator+=’ 上
      ./mobile/god.h:98: 错误:有多余的限定 ‘vector::’ 在成员 ‘operator==’ 上
      ./mobile/god.h:101: 错误:有多余的限定 ‘vector::’ 在成员 ‘operator!=’ 上 
      make: *** [src_rtg/sragent.o] 错误 1
      Ns make failed!
      See 
      ::URL::http://www.isi.edu/nsnam/ns/ns-problems.html  for problems
解决办法:
        分别将这些文件里面的‘vector::'去掉。(同问题1)

10、问题日志:
      dsr/dsragent.cc:828: 错误:‘XmitFlowFailureCallback’ 在此作用域中尚未声明
      dsr/dsragent.cc: In member function ‘void DSRAgent::sendOutPacketWithRoute (SRPacket&, bool, Time)’:
      dsr/dsragent.cc:1385: 错误:
      ‘XmitFailureCallback’ 在此作用域中尚未声明
      dsr/dsragent.cc:1386: 错误:
      ‘XmitFlowFailureCallback’ 在此作用域中尚未声明
      dsr/dsragent.cc:1403: 
        错误:‘XmitFailureCallback’ 在此作用域中尚未声明
      make: *** 
      [dsr/dsragent.o] 错误 1
      Ns make failed!
      See ::URL::http://www.isi.edu/nsnam/ns/ns-
      problems.html for problems
解决办法:
    (将这些函数的作前置声明即可)
    they were declared at the end of the file without a forward declaration. If so, you just need to move it to the beginning of the file or add an forward declaration for the function at the beginning.

11、问题日志:
    diffusion/diffusion.cc:427: 错误:‘XmitFailedCallback’ 在此作用域中尚未声明
    make: *** [diffusion/diffusion.o] 错误 1
    Ns make failed!
    解决办法同问题10。

12、问题日志:
    tcp/tcp-sack-rh.cc:68: 错误:有多余的限定 ‘SackRHTcpAgent::’ 
    在成员 ‘newack’ 上
    make: *** [tcp/tcp-sack-rh.o] 错误 1
    Ns make failed! 
    See ::URL::http://www.isi.edu/nsnam/ns/ns-problems.html  for problems
解决办法同问题2或者3。

13、问题日志:
    pgm/pgm-agent.cc:307: 错误:有多余的限定 ‘PgmAgent::’ 在成员‘trace_event’ 上
    make: *** [pgm/pgm-agent.o] 错误 1
    Ns make failed!
解决办法同问题2或者3。

14、问题日志:
    pgm/pgm-sender.cc:189: 错误:有多余的限定 ‘PgmSender::’ 在成员 ‘trace_event’ 上
    make: *** [pgm/pgm-sender.o] 错误 1
    Ns make failed!
解决办法同问题2或者3。 

15、问题日志:
    pgm/pgm-receiver.cc:186: 错误:有多余的限定 ‘PgmReceiver::’ 在成员 ‘trace_event’ 上
    make: *** [pgm/pgm-receiver.o] 错误 1
    Ns make failed!
解决办法同问题2或者3。  

16、问题日志:
    netgraph.h:71: 错误:有多余的限定 ‘NetGraph::’ 在成员 ‘render’ 上
    make: *** [graphview.o] 错误 1
    Nam make failed! Continue ...
解决办法同问题2或者3。 

17、问题日志:
    parser.h:97: 错误:有多余的限定 ‘ParseTable::‘ 在成员‘nam4wpan’ 上
    parser.h:98: 错误:有多余的限定 ‘ParseTable::’ 在成员 ‘wpan_bradius’ 上
    node.h:226: 错误:有多余的限定 ‘Node::’ 在成员 ‘getTclScriptLabel’ 上
    make: *** [netview.o] 错误 1
    Nam make failed! Continue ...
解决办法同问题2或者3。


18、问题日志:
    ./diffusion3/filter_core/filter_core.hh:111: error: expected `)' before ‘*’ token
    make: *** [diffusion3/ns/diffagent.o] failed!
解决方法:
    edit ns-2.27/diffusion3/filter_core/filter_core.hh,应用补丁如下:
    class DiffusionCoreAgent;
    class HashEntry;
    class NeighborEntry;
    +class DiffRoutingAgent;
    typedef list NeighborList;
    typedef list HashList;

19、问题日志:
    For the nam problem, a patch has been provided for some time (you can search in ns-list archive of Sep. or Oct.), which simply replaces the 'NULL' on line 73 of 'agent.h' with '0'
    (也就是打开agent.h文件,将第73行的 NULL 改成 0 即可)


20、最后,安装终于完成后需要配置环境变量。 安装完成后,会出现提示配置环境变量的界面。在用户目录root下,输入 gedit ~/.bashrc 对环境变量进行配置。加入以下代码:
    export NS_HOME=/root/ns-allinone-2.28
    export PATH="$NS_HOME/nam-1.11:$NS_HOME/tcl8.4.5/unix:$NS_HOME/tk8.4.5/unix:$NS_HOME/bin:$PATH"
    export LD_LIBRARY_PATH=$NS_HOME/tcl8.4.5/unix:$NS_HOME/tk8.4.5/unix:$NS_HOME/otcl-1.9:$NS_HOME/lib:$LD_LIBRARY_PATH
    export TCL_LIBRARY=$NS_HOME/tcl8.4.5/library

至此,在高版本gcc环境下安装ns2.28的主要问题解决告一段落。建议使用ns2.33以上版本,不会出现如上这些问题。除非你有特殊需要,不得不使用低版本的ns软件。
关于安装ns2.33的方法,详见我的上一篇BLOG...那可要简单多了~~

posted on 2011-07-13 20:33  Haidi  阅读(1635)  评论(0编辑  收藏  举报