ns-2 安装error
时间:2010-08-30 来源:Arthursky
kernel panic-not syncing: VFS:Unable to mount root fs on unknow-block(0,0)
solution:我装了个ATI的显卡驱动,卸掉后一切正常。
2、关于不同版本ns2的安装出现的问题的解决方案(此处就ns2.27,2.29,2.31,2.33,2.34作解)
若在ubuntu上安装ns2要先装几个库文件: (1)sudo apt-get install build-essential,这样可以安装gcc,make。 (2)安装tk,tcl sudo apt-get install tcl8.4 sudo apt-get install tcl8.4-dev sudo apt-get install tk8.4 sudo apt-get install tk8.4-dev (3)sudo apt-get install libxmu-dev,是和nam有关的东西。完毕。 以下部分为各版本安装攻略,如有疑问,欢迎留言。。。
问题(1)提示Syntax error: Unterminated quoted string,导致tcl,tk,otcl不能安装的问题
(这个问题是因gcc对语法要求更加严格,其他版本也会出现这个问题,解决办法同此)
安装中提示如下错误:
checking system version (for dynamic loading)... ./configure: 1: Syntax error: Unterminated quoted string tcl8.3.2 configuration failed! Exiting
solution:
终端中,依次输入以下命令,将显示的对应的文件位置的system=MP-RAS-`awk '{print }' /etc/.relid'` 更改为system=MP-RAS-`awk '{print }' /etc/.relid`(即去掉后面的')
grep 'system=MP-RAS-' */* -n
grep 'system=MP-RAS-' */*/* -n
grep 'system=MP-RAS-' */*/*/* -n
然后根据索引到的文件一个一个更改过来。
即分别进入以下目录:
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)
tclcl-mappings.h:51: error: incomplete type ‘Tcl’ used in nested name specifier
tclcl-mappings.h:52: error: invalid use of incomplete type ‘struct Tcl’
tclcl-mappings.h:41: error: forward declaration of ‘struct Tcl’
tclcl-mappings.h:57: error: invalid use of incomplete type ‘struct Tcl’
tclcl-mappings.h:41: error: forward declaration of ‘struct Tcl’
make: *** [Tcl.o] Error 1
tclcl-1.15 make failed! Exiting ...
solution:patch -p0 < ns227-gcc34.patch
问题(3)参见ns-2.29所列问题(1),(2),(3),(4),(9),(5),(6),(7),(8)。
问题(4)
queue/cbq.cc:112: error: ISO C++ forbids declaration of ‘CBQueue’ with no type
queue/cbq.cc:112: error: expected ‘;’ before ‘*’ token
queue/cbq.cc: In member function ‘virtual int CBQueue::insert_class(CBQClass*)’:
queue/cbq.cc:488: error: ‘class CBQClass’ has no member named ‘cbq_’
queue/cbq.cc: In constructor ‘CBQClass::CBQClass()’:
queue/cbq.cc:805: error: class ‘CBQClass’ does not have any field named ‘cbq_’
queue/cbq.cc: In member function ‘virtual void CBQClass::recv(Packet*, Handler*)’:
queue/cbq.cc:850: error: ‘cbq_’ was not declared in this scope
queue/cbq.cc:856: error: ‘cbq_’ was not declared in this scope
queue/cbq.cc: In member function ‘void CBQClass::update(Packet*, double)’:
queue/cbq.cc:873: error: ‘cbq_’ was not declared in this scope
queue/cbq.cc: In member function ‘int CBQClass::desc_with_demand()’:
queue/cbq.cc:928: error: ‘cbq_’ was not declared in this scope
queue/cbq.cc: In member function ‘void CBQClass::newallot(double)’:
queue/cbq.cc:975: error: ‘cbq_’ was not declared in this scope
queue/cbq.cc: In member function ‘virtual int CBQClass::command(int, const char* const*)’:
queue/cbq.cc:1002: error: ‘cbq_’ was not declared in this scope
make: *** [queue/cbq.o] Error 1
solution:$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/queue/cbq.cc
#define POWEROFTWO 16
+class CBQueue;
class CBQClass : public Connector {
问题(5)
./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
solution:$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/tora/tora_neighbor.h
#define __tora_neighbor_h__
+class toraAgent;
enum LinkStatus {
问题(6)
./diffusion3/filter_core/filter_core.hh:111: 错误:expected `)' before ‘*’ token
make: *** [diffusion3/ns/diffagent.o] 错误 1
solution:$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/diffusion3/filter_core/filter_core.hh
class NeighborEntry;
+class DiffRoutingAgent;
typedef list<NeighborEntry *> NeighborList;
2) ns-2.29 安装 (ps:解压ns2.29,修改nam文件夹中agent.h的73行,将null改为0)
问题(1) -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
solution:将文件ns2.29/sctp.h里面第705行DumpSendBuffer函数前面的'SctpAgent::'去掉。
问题(2)
./mobile/god.h:88: error: extra qualification ‘vector::’ on member ‘operator=’
./mobile/god.h:93: error: extra qualification ‘vector::’ on member ‘operator+=’
./mobile/god.h:98: error: extra qualification ‘vector::’ on member ‘operator==’
./mobile/god.h:101: error: extra qualification ‘vector::’ on member ‘operator!=’
make: *** [src_rtg/sragent.o] Error 1
solution: 分别将这些文件里面的‘vector::'去掉。
问题(3)
dsr/dsragent.cc:828: error: ‘XmitFlowFailureCallback’ was not declared in this scope
dsr/dsragent.cc:1385: error: ‘XmitFailureCallback’ was not declared in this scope
dsr/dsragent.cc:1386: error: ‘XmitFlowFailureCallback’ was not declared in this scope
dsr/dsragent.cc:1403: error: ‘XmitFailureCallback’ was not declared in this scope
make: *** [dsr/dsragent.o] Error 1
solution:It is unclear to me which version of the code and compiler you are using. But it looks very similar to an error that I encountered with the CVS version and the latest gcc version. You should look into the file if you can find the missing function. In my case it was declared at the endof 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.
+void XmitFlowFailureCallback(Packet *pkt, void *data); //+即增加,-即去掉
+void XmitFailureCallback(Packet *pkt, void *data);
/*===========================================================================
SendBuf management and helpers
问题(4)
diffusion/diffusion.cc:427: error:‘XmitFailedCallback’ was not declared in this scope
make: *** [diffusion/diffusion.o] error 1
solution:$gedit /usr/NS2/ns-allinone-2.29/ns-2.29/diffusion/diffusion.cc
#include "routing_table.h"
+void XmitFailedCallback(Packet *pkt, void *data);
char *MsgStr[]= {"", "INTEREST", "DATA", "DATA_READY", "DATA_REQUEST",
问题(5)
tcp/tcp-sack-rh.cc:68: 错误:有多余的限定 ‘SackRHTcpAgent::’在成员 ‘newack’ 上
make: *** [tcp/tcp-sack-rh.o] 错误 1
solution:同问题(1)和(2)
问题(6)
pgm/pgm-agent.cc:307: 错误:有多余的限定 ‘PgmAgent::’ 在成员 ‘trace_event’ 上
make: *** [pgm/pgm-agent.o] 错误 1
solution:同问题(1)
问题(7)
pgm/pgm-sender.cc:189: 错误:有多余的限定 ‘PgmSender::’ 在成员 ‘trace_event’ 上
make: *** [pgm/pgm-sender.o] 错误 1
问题(8)
pgm/pgm-receiver.cc:186: 错误:有多余的限定 ‘PgmReceiver::’在成员 ‘trace_event’ 上
make: *** [pgm/pgm-receiver.o] 错误 1
问题(9)
diffusion/omni_mcast.cc:367: 错误:‘OmniMcastXmitFailedCallback’在此作用域中尚未声明
make: *** [diffusion/omni_mcast.o] 错误 1
solution:$gedit /usr/NS2/ns-allinone-2.29/ns-2.29/diffusion/omni_mcast.cc
#include "god.h"
+void OmniMcastXmitFailedCallback(Packet *pkt, void *data);
static class OmniMcastClass : public TclClass {