ns-allinone-2.27 安装错误集锦
转自:http://www.baisi.net/thread-2467503-1-1.html
为了装Leach协议,原来装的好好的ns-allinone-2.33被我弄崩了,只好装个ns-allinone-2.27普遍版。谁知,估计ns2能遇见的所有安装问题都被我遇见了,从一开始的安装包就出这样或那样的问题,皑皑。
记录下来吧,免得以后忘掉了,有些错误真的很BT,网上搜的解决方法也BT,不知道他们都是怎么想出来的,赫赫。
问题:
checking system version (for dynamic loading)... ./configure: line 7624: syntax error near unexpected token `)'
./configure: lline 7624: ` OSF*)'
tcl8.3.2 configuration failed! Exiting ...
解决:
把以下文件中的.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
问题:
clcl-mappings.h: In static member function `static int TclObjectHelper<T>::dispatch_(void*, Tcl_Interp*, int, char**)':
tclcl-mappings.h:51: error: incomplete type `Tcl' used in nested name specifier
tclcl-mappings.h:52: error: invalid use of undefined type `struct Tcl'
tclcl-mappings.h:41: error: forward declaration of `struct Tcl'
tclcl-mappings.h:57: error: invalid use of undefined type `struct Tcl'
tclcl-mappings.h:41: error: forward declaration of `struct Tcl'
make: *** [Tcl.o] Error 1
tclcl-1.15 make failed! Exiting
解决:
下载对应的gcc的安装布丁,然后再安装。把补丁放在和ns-allinone-2.27同一个目录下面进行如下操作:
1. get a fresh ns-allinone-2.27.tar.gz
2. tar zxvf ns-allinone-2.27.tar.gz
3. patch -p0 < ns227-gcc34.patch
4. cd ns-allinone-2.27
5. ./install
问题:
./sctp/sctp.h:632: 错误:有多余的限定‘SctpAgent::’在成员‘DumpSendBuffer’上
trace/trace.cc:185: 警告:不建议使用从字符串常量到‘char*’的转换
trace/trace.cc:185: 警告:不建议使用从字符串常量到‘char*’的转换
trace/trace.cc:185: 警告:不建议使用从字符串常量到‘char*’的转换
trace/trace.cc:185: 警告:不建议使用从字符串常量到‘char*’的转换
trace/trace.cc:185: 警告:不建议使用从字符串常量到‘char*’的转换
make: *** [trace/trace.o] 错误 1
Ns make failed!
解决:
$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/sctp/sctp.h
void SctpAgent::DumpSendBuffer();
改为:
void DumpSendBuffer();
问题:解决:
./mobile/god.h: At global scope:
./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!
解决:
$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/mobile/god.h
inline void vector::operator=(const vector a)
inline void vector::operator+=(const vector a)
inline int vector::operator==(const vector a)
inline int vector::operator!=(const vector a)
改为:
inline void operator=(const vector a)
inline void operator+=(const vector a)
inline int operator==(const vector a)
inline int operator!=(const vector a)
问题:
queue/cbq.cc:112: 错误:ISO C++ 不允许声明无类型的‘CBQueue’
queue/cbq.cc:112: 错误:expected ‘;’ before ‘*’ token
queue/cbq.cc: In member function ‘virtual int CBQueue::insert_class(CBQClass*)’:
queue/cbq.cc:488: 错误:‘class CBQClass’没有名为‘cbq_’的成员
queue/cbq.cc: In constructor ‘CBQClass::CBQClass()’:
queue/cbq.cc:805: 错误:类‘CBQClass’没有名为‘cbq_’的字段
queue/cbq.cc: In member function ‘virtual void CBQClass::recv(Packet*, Handler*)’:
queue/cbq.cc:850: 错误:‘cbq_’在此作用域中尚未声明
queue/cbq.cc:856: 错误:‘cbq_’在此作用域中尚未声明
queue/cbq.cc: In member function ‘void CBQClass::update(Packet*, double)’:
queue/cbq.cc:873: 错误:‘cbq_’在此作用域中尚未声明
queue/cbq.cc: In member function ‘int CBQClass::desc_with_demand()’:
queue/cbq.cc:928: 错误:‘cbq_’在此作用域中尚未声明
queue/cbq.cc: In member function ‘void CBQClass::newallot(double)’:
queue/cbq.cc:975: 错误:‘cbq_’在此作用域中尚未声明
queue/cbq.cc: In member function ‘virtual int CBQClass::command(int, const char* const*)’:
queue/cbq.cc:1002: 错误:‘cbq_’在此作用域中尚未声明
make: *** [queue/cbq.o] 错误 1
Ns make failed!
解决:(+就是添加,-就是去掉咯)
$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/queue/cbq.cc
#define POWEROFTWO 16
+class CBQueue;
class CBQClass : public Connector {
问题:
./tora/tora_neighbor.h:72: 错误:ISO C++ 不允许声明无类型的‘toraAgent’
./tora/tora_neighbor.h:72: 错误:expected ‘;’ before ‘*’ token
tora/tora.cc: In member function ‘void toraAgent::rt_resolve(Packet*)’:
tora/tora.cc:238: 警告:不建议使用从字符串常量到‘char*’的转换
tora/tora.cc: In member function ‘void toraAgent::recvUPD(Packet*)’:
tora/tora.cc:462: 警告:不建议使用从字符串常量到‘char*’的转换
tora/tora.cc: In member function ‘void toraAgent::recvCLR(Packet*)’:
tora/tora.cc:648: 警告:不建议使用从字符串常量到‘char*’的转换
make: *** [tora/tora.o] 错误 1
Ns make failed!
解决:
$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/tora/tora_neighbor.h
#define __tora_neighbor_h__
+class toraAgent;
enum LinkStatus {
问题:
dsr/dsragent.cc:787: 错误:‘XmitFlowFailureCallback’在此作用域中尚未声明
dsr/dsragent.cc:1344: 错误:‘XmitFailureCallback’在此作用域中尚未声明
make: *** [dsr/dsragent.o] 错误 1
Ns make failed!
解决:
$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/dsr/dsragent.cc
+void XmitFlowFailureCallback(Packet *pkt, void *data);
+void XmitFailureCallback(Packet *pkt, void *data);
/*===========================================================================
SendBuf management and helpers
问题:
diffusion/diffusion.cc:404: 错误:‘XmitFailedCallback’在此作用域中尚未声明
make: *** [diffusion/diffusion.o] 错误 1
Ns make failed!
解决:
$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/diffusion/diffusion.cc
#include "routing_table.h"
+void XmitFailedCallback(Packet *pkt, void *data);
char *MsgStr[]= {"", "INTEREST", "DATA", "DATA_READY", "DATA_REQUEST",
问题:
diffusion/omni_mcast.cc:367: 错误:‘OmniMcastXmitFailedCallback’在此作用域中尚未声明
make: *** [diffusion/omni_mcast.o] 错误 1
Ns make failed!
解决:
$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/diffusion/omni_mcast.cc
#include "god.h"
+void OmniMcastXmitFailedCallback(Packet *pkt, void *data);
static class OmniMcastClass : public TclClass {
问题:
tcp/tcp-sack-rh.cc:68: 错误:有多余的限定‘SackRHTcpAgent::’在成员‘newack’上
make: *** [tcp/tcp-sack-rh.o] 错误 1
Ns make failed!
解决:
$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/tcp/tcp-sack-rh.cc
virtual void computefack();
//virtual void SackRHTcpAgent::newack(Packet* pkt);
+virtual void newack(Packet *pkt);
问题:
pgm/pgm-agent.cc:278: 错误:有多余的限定‘PgmAgent::’在成员‘trace_event’上
pgm/pgm-agent.cc: In member function ‘void PgmAgent::handle_rdata(Packet*)’:
pgm/pgm-agent.cc:578: 警告:不建议使用从字符串常量到‘char*’的转换
pgm/pgm-agent.cc: In member function ‘void PgmAgent::handle_nak(Packet*)’:
pgm/pgm-agent.cc:727: 警告:不建议使用从字符串常量到‘char*’的转换
pgm/pgm-agent.cc: In member function ‘void PgmAgent::handle_ncf(Packet*)’:
pgm/pgm-agent.cc:824: 警告:不建议使用从字符串常量到‘char*’的转换
make: *** [pgm/pgm-agent.o] 错误 1
Ns make failed!
解决:
$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/pgm/pgm-agent.cc
void print_stats();
-//void PgmAgent::trace_event(char *evType, double evTime);
+void trace_event(char *evType, double evTime);
问题:
pgm/pgm-sender.cc:160: 错误:有多余的限定‘PgmSender::’在成员‘trace_event’上
pgm/pgm-sender.cc: In member function ‘virtual void PgmSender::handle_nak(Packet*)’:
pgm/pgm-sender.cc:472: 警告:不建议使用从字符串常量到‘char*’的转换
pgm/pgm-sender.cc: In member function ‘virtual void PgmSender::send_rdata(RdataItem*)’:
pgm/pgm-sender.cc:619: 警告:不建议使用从字符串常量到‘char*’的转换
make: *** [pgm/pgm-sender.o] 错误 1
Ns make failed!
解决:
$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/pgm/pgm-sender.cc
-//void PgmSender::trace_event(char *evType, nsaddr_t daddr, double evTime);
+void trace_event(char *evType, nsaddr_t daddr, double evTime);
问题:
pgm/pgm-receiver.cc:157: 错误:有多余的限定‘PgmReceiver::’在成员‘trace_event’上
pgm/pgm-receiver.cc: In member function ‘void PgmReceiver::generate_Nak(int)’:
pgm/pgm-receiver.cc:589: 警告:不建议使用从字符串常量到‘char*’的转换
make: *** [pgm/pgm-receiver.o] 错误 1
Ns make failed!
解决:
$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/pgm/pgm-receiver.cc
-void PgmReceiver::trace_event(char *evType, double evTime);
+void trace_event(char *evType, double evTime);
问题:
./diffusion3/filter_core/filter_core.hh:111: 错误:expected `)' before ‘*’ token
make: *** [diffusion3/ns/diffagent.o] 错误 1
Ns make failed!
解决:
$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/diffusion3/filter_core/filter_core.hh
class NeighborEntry;
+class DiffRoutingAgent;
typedef list<NeighborEntry *> NeighborList;
nam/agent.h:73行NULL->0