gcc2.95下 使用ns2.1b8a-allinone 然后配合ns2.30中的ns外其他组件进行安装 ns2.1b8a 同时使得nam中文字得以显示

usr/include/bits/socket.h:433: warning: its scope is only this definition or declaration, which is probably not what you want.
/usr/include/bits/socket.h:440: warning: `struct mmsghdr' declared inside parameter list
/home/linxiaoyuan/ns-allinone-2.1b8a/tcl8.4.13/unix/../generic/tclExecute.c: In function `ExprWideFunc':
/home/linxiaoyuan/ns-allinone-2.1b8a/tcl8.4.13/unix/../generic/tclExecute.c:5313: `__LONG_LONG_MAX__' undeclared (first use in this function)
/home/linxiaoyuan/ns-allinone-2.1b8a/tcl8.4.13/unix/../generic/tclExecute.c:5313: (Each undeclared identifier is reported only once
/home/linxiaoyuan/ns-allinone-2.1b8a/tcl8.4.13/unix/../generic/tclExecute.c:5313: for each function it appears in.)
/home/linxiaoyuan/ns-allinone-2.1b8a/tcl8.4.13/unix/../generic/tclExecute.c: In function `ExprRoundFunc':
/home/linxiaoyuan/ns-allinone-2.1b8a/tcl8.4.13/unix/../generic/tclExecute.c:5502: `__LONG_LONG_MAX__' undeclared (first use in this function)
make: *** [tclExecute.o] Error 1
tcl8.4.13 make failed! Exiting ...




ns-allinone-2.1b8a/tcl8.4.13/unix/../generic/tclExecute.c: In function `ExprWideFunc':
/ns-allinone-2.1b8a/tcl8.4.13/unix/../generic/tclExecute.c:5313: `__LONG_LONG_MAX__' undeclared (first use in this function)
/ns-allinone-2.1b8a/tcl8.4.13/unix/../generic/tclExecute.c:5313: (Each undeclared identifier is reported only once




在对应文件中 加入   
/* Minimum and maximum values a `signed long long int' can hold. */
#ifndef __LONG_LONG_MAX__
#define __LONG_LONG_MAX__ 9223372036854775807LL
#endif






===============
/home/linxiaoyuan/ns-allinone-2.1b8a/tcl8.4.13/unix/../generic/tclObj.c:1767: `__LONG_LONG_MAX__' undeclared (first use in this function)
/home/linxiaoyuan/ns-allinone-2.1b8a/tcl8.4.13/unix/../generic/tclObj.c:1767: (Each undeclared identifier is reported only once
/home/linxiaoyuan/ns-allinone-2.1b8a/tcl8.4.13/unix/../generic/tclObj.c:1767: for each function it appears in.)
make: *** [tclObj.o] Error 1
tcl8.4.13 make failed! Exiting ...
For problems with Tcl/Tk see http://www.scriptics.com




zai tclInt.h中添加  


/* Minimum and maximum values a `signed long long int' can hold. */
#ifndef __LONG_LONG_MAX__
#define __LONG_LONG_MAX__ 9223372036854775807LL
#endif


=====================================


Tcl.cc:509:57: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Tcl.cc:511:61: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Tcl.cc: In static member function ‘static int TclClass::dispatch_instvar(ClientData, Tcl_Interp*, int, const char**)’:
Tcl.cc:566:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
Tcl.cc:571:72: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Tcl.cc: In member function ‘virtual void TclClass::bind()’:
Tcl.cc:603:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Tcl.cc:605:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
make: *** [Tcl.o] Error 1
tclcl-1.18 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems






-char *p = strchr(localName, '(');
+char *p = const_cast <char*>(strchr(localName, '('));




=============================


checking for ANSI C header files... yes
checking for string.h... yes
checking for main in -lXbsd... no
checking for socket in -lsocket... no
checking for gethostbyname in -lnsl... yes
checking for dcgettext in -lintl... no
checking for getnodebyname in -ldnet_stub... no
checking that c++ can handle -O2... yes
checking standard STL is available... no
checking for tcl.h... -I../include
checking for libtcl8.3... no
checking for init.tcl... ../tcl8.3.2/library
checking for tclsh8.3.2... no
checking for tclsh8.3... no
checking for tclsh... /home/linxiaoyuan/ns-allinone-2.1b8a/tcl8.4.13/unix/tclsh
configure: error: Installation of tcl seems incomplete or can't be found automatically.
Please correct the problem by telling configure where tcl is
using the argument --with-tcl=/path/to/package
(perhaps after installing it),
or the package is not required, disable it with --with-tcl=no.
Ns configuration failed! Exiting ...
Please check http://www.isi.edu/nsnam/ns/ns-problems.html
for common problems and bug fixes.


安装ns的时候 报错 说找不到tcl
 
 
 把  ns对应包中configure文件里的
# Check whether --with-tcl-ver or --without-tcl-ver was given.
if test "${with_tcl_ver+set}" = set; then
  withval="$with_tcl_ver"
  TCL_VERS=$withval
else
  TCL_VERS=8.4.13
fi



 TCL_VERS=8.3.1
 
 改成
 
  TCL_VERS=8.4.13
===================
在执行找不到 tk

 # Check whether --with-tk-ver or --without-tk-ver was given.
if test "${with_tk_ver+set}" = set; then
  withval="$with_tk_ver"
  TK_VERS=$withval
else
  TK_VERS=8.3.1
fi




中的 
TK_VERS=8.3.1


改成 
 
TK_VERS=8.4.13
//
在执行找不到tclcl



对应的改正tcl的  tclcl的 




TCLCL_VERS=1.0b11




改成 
TCLCL_VERS=1.18


===================
执行sudo make 的时候报错


[-Wwrite-strings]
In file included from trace.cc:44:0:
tfrc.h: At global scope:
tfrc.h:116:3: error: a class-key must be used when declaring a friend
tfrc.h:116:3: error: friend declaration does not name a class or function
tfrc.h:117:2: error: a class-key must be used when declaring a friend
tfrc.h:117:2: error: friend declaration does not name a class or function
trace.cc:163:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
trace.cc:163:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
trace.cc:163:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
trace.cc:163:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
trace.cc:163:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
make: *** [trace.o] Error 1










friend  后面加上 class


===================
AVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCL_H  -DHAVE_CONFIG_H -I. -I/home/linxiaoyuan/ns-allinone-2.1b8a/tclcl-1.18 -I/home/linxiaoyuan/ns-allinone-2.1b8a/otcl-1.0a7 -I/home/linxiaoyuan/ns-allinone-2.1b8a/include -I/home/linxiaoyuan/ns-allinone-2.1b8a/include -o src_rtg/classifier-sr.o src_rtg/classifier-sr.cc
src_rtg/classifier-sr.cc:38:22: fatal error: iostream.h: No such file or directory
compilation terminated.
make: *** [src_rtg/classifier-sr.o] Error 1
linxiaoyuan@linxiaoyuan-virtual-machine:~/ns-allinone-2.1b8a/ns-2.1b8a$ ^C
linxiaoyuan@linxiaoyuan-virtual-machine:~/ns-allinone-2.1b8a/ns-2.1b8a$ sudo gedit src_rtg/classifier-sr.cc




-#include <iostream.h>
+#include <iostream>
+using namespace std;


===============
./route.h:46:0: warning: "INFINITY" redefined [enabled by default]
/usr/include/i386-linux-gnu/bits/inf.h:27:0: note: this is the location of the previous definition
src_rtg/sragent.cc:57:21: fatal error: fstream.h: No such file or directory
compilation terminated.
make: *** [src_rtg/sragent.o] Error 1






-#include <fstream.h>
+#include <fstream>
+using namespace std;


-=========================
./god.h: At global scope:
./god.h:88:14: error: extra qualification ‘vector::’ on member ‘operator=’ [-fpermissive]
./god.h:93:14: error: extra qualification ‘vector::’ on member ‘operator+=’ [-fpermissive]
./god.h:98:13: error: extra qualification ‘vector::’ on member ‘operator==’ [-fpermissive]
./god.h:101:13: error: extra qualification ‘vector::’ on member ‘operator!=’ [-fpermissive]
make: *** [src_rtg/sragent.o] Error 1


去掉对应的vector::


===========


tcp-rbp.cc: At global scope:
tcp-rbp.cc:72:2: error: a class-key must be used when declaring a friend
tcp-rbp.cc:72:2: error: friend declaration does not name a class or function
tcp-rbp.cc: In member function ‘virtual void RBPVegasPaceTimer::expire(Event*)’:
tcp-rbp.cc:83:7: error: ‘void RBPVegasTcpAgent::paced_send_one()’ is protected
tcp-rbp.cc:104:62: error: within this context
tcp-rbp.cc: At global scope:
tcp-rbp.cc:234:2: error: a class-key must be used when declaring a friend
tcp-rbp.cc:234:2: error: friend declaration does not name a class or function
tcp-rbp.cc: In member function ‘virtual void RBPRenoPaceTimer::expire(Event*)’:
tcp-rbp.cc:245:7: error: ‘void RBPRenoTcpAgent::paced_send_one()’ is protected
tcp-rbp.cc:266:61: error: within this context
make: *** [tcp-rbp.o] Error 1




friend 后面都加上class




===========


tcp-full.h: At global scope:
tcp-full.h:131:2: error: a class-key must be used when declaring a friend
tcp-full.h:131:2: error: friend declaration does not name a class or function
make: *** [tcp-full.o] Error 1






friend 后面都加上class


===================
red.cc: In member function ‘virtual void REDQueue::trace(TracedVar*)’:
red.cc:630:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
red.cc:631:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
red.cc:632:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
make: *** [red.o] Error 1










REDQueue::trace(TracedVar* v)
{
- char wrk[500], *p;
+ char  wrk[500];
+ char* p;
- if (((p = strstr(v->name(), "ave")) == NULL) &&
-    ((p = strstr(v->name(), "prob")) == NULL) &&
-    ((p = strstr(v->name(), "curq")) == NULL) &&
-    ((p = strstr(v->name(), "cur_max_p"))==NULL) ) {
+ if (((p = const_cast <char*> (strstr(v->name(), "ave"))) == NULL) &&
+    ((p = const_cast <char*> (strstr(v->name(), "prob"))) == NULL) &&
+    ((p = const_cast <char*> (strstr(v->name(), "curq"))) == NULL) &&
+    ((p = const_cast <char*> (strstr(v->name(), "cur_max_p")))==NULL) ) {
fprintf(stderr, "RED:unknown trace var %s\n",
v->name());
return;
}
==============================


[-Wwrite-strings]
sfq.cc: At global scope:
sfq.cc:52:3: error: a class-key must be used when declaring a friend
sfq.cc:52:3: error: friend declaration does not name a class or function
sfq.cc: In member function ‘void SFQ::clear()’:
sfq.cc:55:7: error: ‘int PacketSFQ::pkts’ is protected
sfq.cc:126:12: error: within this context
sfq.cc: In member function ‘void SFQ::initsfq()’:
sfq.cc:51:3: error: ‘PacketSFQ::PacketSFQ()’ is private
sfq.cc:138:34: error: within this context
sfq.cc: In member function ‘virtual Packet* SFQ::deque()’:
sfq.cc:55:7: error: ‘int PacketSFQ::pkts’ is protected
sfq.cc:190:13: error: within this context
sfq.cc:55:7: error: ‘int PacketSFQ::pkts’ is protected
sfq.cc:196:15: error: within this context
sfq.cc:70:22: error: ‘PacketSFQ* PacketSFQ::idle(PacketSFQ*)’ is protected
sfq.cc:197:33: error: within this context
sfq.cc:57:14: error: ‘PacketSFQ* PacketSFQ::next’ is protected
sfq.cc:199:22: error: within this context
sfq.cc: In member function ‘virtual void SFQ::enque(Packet*)’:
sfq.cc:55:7: error: ‘int PacketSFQ::pkts’ is protected
sfq.cc:214:13: error: within this context
sfq.cc:55:7: error: ‘int PacketSFQ::pkts’ is protected
sfq.cc:227:8: error: within this context
sfq.cc:55:7: error: ‘int PacketSFQ::pkts’ is protected
sfq.cc:228:10: error: within this context
sfq.cc:58:22: error: ‘PacketSFQ* PacketSFQ::activate(PacketSFQ*)’ is protected
sfq.cc:229:32: error: within this context
make: *** [sfq.o] Error 1


======================


drr.cc: At global scope:
drr.cc:37:2: error: a class-key must be used when declaring a friend
drr.cc:37:2: error: friend declaration does not name a class or function
drr.cc: In member function ‘PacketDRR* DRR::getMaxflow(PacketDRR*)’:
drr.cc:43:13: error: ‘PacketDRR* PacketDRR::next’ is protected
drr.cc:96:47: error: within this context
drr.cc:41:6: error: ‘int PacketDRR::bcount’ is protected
drr.cc:97:17: error: within this context
drr.cc:41:6: error: ‘int PacketDRR::bcount’ is protected
drr.cc:97:31: error: within this context
drr.cc: In member function ‘virtual void DRR::enque(Packet*)’:
drr.cc:36:2: error: ‘PacketDRR::PacketDRR()’ is private
drr.cc:147:29: error: within this context
drr.cc:40:6: error: ‘int PacketDRR::src’ is protected
drr.cc:153:9: error: within this context
drr.cc:40:6: error: ‘int PacketDRR::src’ is protected
drr.cc:154:6: error: within this context
drr.cc:40:6: error: ‘int PacketDRR::src’ is protected
drr.cc:156:10: error: within this context
drr.cc:40:6: error: ‘int PacketDRR::src’ is protected
drr.cc:157:69: error: within this context
drr.cc:39:6: error: ‘int PacketDRR::pkts’ is protected
drr.cc:160:7: error: within this context
drr.cc:41:6: error: ‘int PacketDRR::bcount’ is protected
drr.cc:162:5: error: within this context
drr.cc:39:6: error: ‘int PacketDRR::pkts’ is protected
drr.cc:166:9: error: within this context
drr.cc:46:21: error: ‘PacketDRR* PacketDRR::activate(PacketDRR*)’ is protected
drr.cc:168:27: error: within this context
drr.cc:44:6: error: ‘int PacketDRR::deficitCounter’ is protected
drr.cc:169:7: error: within this context
drr.cc:41:6: error: ‘int PacketDRR::bcount’ is protected
drr.cc:180:9: error: within this context
drr.cc:39:6: error: ‘int PacketDRR::pkts’ is protected
drr.cc:183:11: error: within this context
drr.cc:39:6: error: ‘int PacketDRR::pkts’ is protected
drr.cc:185:13: error: within this context
drr.cc:58:21: error: ‘PacketDRR* PacketDRR::idle(PacketDRR*)’ is protected
drr.cc:186:24: error: within this context
drr.cc: In member function ‘virtual Packet* DRR::deque()’:
drr.cc:45:6: error: ‘int PacketDRR::turn’ is protected
drr.cc:203:14: error: within this context
drr.cc:44:6: error: ‘int PacketDRR::deficitCounter’ is protected
drr.cc:204:10: error: within this context
drr.cc:45:6: error: ‘int PacketDRR::turn’ is protected
drr.cc:205:10: error: within this context
drr.cc:44:6: error: ‘int PacketDRR::deficitCounter’ is protected
drr.cc:211:13: error: within this context
drr.cc:44:6: error: ‘int PacketDRR::deficitCounter’ is protected
drr.cc:212:10: error: within this context
drr.cc:41:6: error: ‘int PacketDRR::bcount’ is protected
drr.cc:214:10: error: within this context
drr.cc:39:6: error: ‘int PacketDRR::pkts’ is protected
drr.cc:215:12: error: within this context
drr.cc:39:6: error: ‘int PacketDRR::pkts’ is protected
drr.cc:218:14: error: within this context
drr.cc:45:6: error: ‘int PacketDRR::turn’ is protected
drr.cc:219:11: error: within this context
drr.cc:44:6: error: ‘int PacketDRR::deficitCounter’ is protected
drr.cc:221:11: error: within this context
drr.cc:58:21: error: ‘PacketDRR* PacketDRR::idle(PacketDRR*)’ is protected
drr.cc:222:25: error: within this context
drr.cc:45:6: error: ‘int PacketDRR::turn’ is protected
drr.cc:227:10: error: within this context
drr.cc:43:13: error: ‘PacketDRR* PacketDRR::next’ is protected
drr.cc:228:15: error: within this context
drr.cc: In member function ‘void DRR::clear()’:
drr.cc:39:6: error: ‘int PacketDRR::pkts’ is protected
drr.cc:243:10: error: within this context
make: *** [drr.o] Error 1






================


cbq.cc: At global scope:
cbq.cc:112:2: error: ‘CBQueue’ does not name a type
cbq.cc: In member function ‘virtual int CBQueue::insert_class(CBQClass*)’:
cbq.cc:488:5: error: ‘class CBQClass’ has no member named ‘cbq_’
cbq.cc: In constructor ‘CBQClass::CBQClass()’:
cbq.cc:805:24: error: class ‘CBQClass’ does not have any field named ‘cbq_’
cbq.cc: In member function ‘virtual void CBQClass::recv(Packet*, Handler*)’:
cbq.cc:850:6: error: ‘cbq_’ was not declared in this scope
cbq.cc:856:7: error: ‘cbq_’ was not declared in this scope
cbq.cc: In member function ‘void CBQClass::update(Packet*, double)’:
cbq.cc:873:19: error: ‘cbq_’ was not declared in this scope
cbq.cc: In member function ‘int CBQClass::desc_with_demand()’:
cbq.cc:928:16: error: ‘cbq_’ was not declared in this scope
cbq.cc: In member function ‘void CBQClass::newallot(double)’:
cbq.cc:975:20: error: ‘cbq_’ was not declared in this scope
cbq.cc: In member function ‘virtual int CBQClass::command(int, const char* const*)’:
cbq.cc:1002:8: error: ‘cbq_’ was not declared in this scope
make: *** [cbq.o] Error 1




#define POWEROFTWO 16
+class CBQueue;
class CBQClass : public Connector 


=============================


[-Wwrite-strings]
packet.h:205:26: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
packet.h:208:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
packet.h:211:33: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
packet.h:214:25: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
packet.h:217:24: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
packet.h:219:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
In file included from snoop.cc:40:0:
snoop.h: At global scope:
snoop.h:114:2: error: a class-key must be used when declaring a friend
snoop.h:114:2: error: friend declaration does not name a class or function
snoop.h:115:2: error: a class-key must be used when declaring a friend
snoop.h:115:2: error: friend declaration does not name a class or function
snoop.h: In member function ‘virtual void SnoopRxmitHandler::handle(Event*)’:
snoop.h:169:31: error: ‘Packet* Snoop::pkts_ [100]’ is protected
snoop.cc:761:22: error: within this context
snoop.h:168:11: error: ‘short int Snoop::buftail_’ is protected
snoop.cc:761:36: error: within this context
snoop.h:167:12: error: ‘Event* Snoop::toutPending_’ is protected
snoop.cc:762:10: error: within this context
snoop.h:159:18: error: ‘int Snoop::lastAck_’ is protected
snoop.cc:766:29: error: within this context
snoop.h:166:11: error: ‘short int Snoop::bufhead_’ is protected
snoop.cc:768:15: error: within this context
snoop.h:168:11: error: ‘short int Snoop::buftail_’ is protected
snoop.cc:768:35: error: within this context
snoop.h:157:11: error: ‘u_short Snoop::fstate_’ is protected
snoop.cc:769:15: error: within this context
snoop.h:160:11: error: ‘int Snoop::expNextAck_’ is protected
snoop.cc:772:12: error: within this context
snoop.h:168:11: error: ‘short int Snoop::buftail_’ is protected
snoop.cc:772:47: error: within this context
make: *** [snoop.o] Error 1


friend 后面加上 class




========


mip-reg.cc: In member function ‘virtual void MIPBSAgent::recv(Packet*, Handler*)’:
mip-reg.cc:145:53: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
mip-reg.cc:147:16: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
make: *** [mip-reg.o] Error 1


-obj = (NsObject*)tcl.lookup(objname = tcl.result());
+obj = (NsObject*)tcl.lookup(objname = const_cast <char*> (tcl.result()));
==============================
mobilenode.cc: In member function ‘virtual int MobileNode::command(int, const char* const*)’:
mobilenode.cc:186:27: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
mobilenode.cc:193:27: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
mobilenode.cc:196:21: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
make: *** [mobilenode.o] Error 1




-char *str = tcl.result();
+char *str = const_cast <char*>(tcl.result());


另外两个类似
==================
./imep/rxmit_queue.h: At global scope:
./imep/rxmit_queue.h:61:3: error: a class-key must be used when declaring a friend
./imep/rxmit_queue.h:61:3: error: friend declaration does not name a class or function
./imep/rxmit_queue.h: In member function ‘ReXmitQIter ReXmitQ::iter()’:
./imep/rxmit_queue.h:72:3: error: ‘ReXmitQIter::ReXmitQIter(rexent*)’ is private
./imep/rxmit_queue.h:85:37: error: within this context
imep/imep.cc: In member function ‘void imepAgent::removeObjectResponse(Packet*, nsaddr_t)’:
imep/imep.cc:208:73: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:215:43: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:232:24: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc: In member function ‘void imepAgent::purgeReXmitQ(nsaddr_t)’:
imep/imep.cc:254:31: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:277:39: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:294:27: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc: In member function ‘void imepAgent::handlerControlTimer()’:
imep/imep.cc:435:62: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc: In member function ‘void imepAgent::handlerReXmitTimer()’:
imep/imep.cc:460:55: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:470:56: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:488:48: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:503:69: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc: In member function ‘void imepAgent::handlerIncomingTimer()’:
imep/imep.cc:517:28: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:531:48: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:546:34: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:561:45: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:573:47: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc: In member function ‘void imepAgent::scheduleIncoming(Packet*, u_int32_t)’:
imep/imep.cc:601:24: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc: In member function ‘void imepAgent::imep_ack_input(Packet*)’:
imep/imep.cc:753:36: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc: In member function ‘void imepAgent::imep_object_input(Packet*)’:
imep/imep.cc:807:56: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:820:56: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:829:36: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:838:62: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:859:64: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc: In member function ‘void imepAgent::Terminate()’:
imep/imep.cc:1051:24: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:1056:24: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:1061:22: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:1067:29: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:1074:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:1080:42: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:1087:28: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
imep/imep.cc:1093:25: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
make: *** [imep/imep.o] Error 1




./imep/rxmit_queue.h文件的friend  后加上class
===================
/tora/tora_neighbor.h:72:9: error: ‘toraAgent’ does not name a type
tora/tora.cc: In member function ‘void toraAgent::rt_resolve(Packet*)’:
tora/tora.cc:238:29: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
tora/tora.cc: In member function ‘void toraAgent::recvTORA(Packet*)’:
tora/tora.cc:345:37: warning: reading through null pointer (argument 3) [-Wformat]
tora/tora.cc: In member function ‘void toraAgent::recvUPD(Packet*)’:
tora/tora.cc:464:42: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
tora/tora.cc: In member function ‘void toraAgent::recvCLR(Packet*)’:
tora/tora.cc:650:47: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
make: *** [tora/tora.o] Error 1








solution:$gedit /usr/NS2/ns-allinone-2.27/ns-2.27/tora/tora_neighbor.h
#define __tora_neighbor_h__
+class toraAgent;
enum LinkStatus
=======================
 [-Wwrite-strings]
./packet.h:197:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:198:23: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:199:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:202:21: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:205:26: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:208:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:211:33: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:214:25: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:217:24: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:219:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
c++ -c -O2 -DTCP_DELAY_BIND_ALL -DNO_TK -DNIXVECTOR -DTCLCL_CLASSINSTVAR  -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_0A7 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCL_H  -DHAVE_CONFIG_H -I. -I/home/linxiaoyuan/ns-allinone-2.1b8a/tclcl-1.18 -I/home/linxiaoyuan/ns-allinone-2.1b8a/otcl-1.0a7 -I/home/linxiaoyuan/ns-allinone-2.1b8a/include -I/home/linxiaoyuan/ns-allinone-2.1b8a/include -o dsr/dsragent.o dsr/dsragent.cc
In file included from ./scheduler.h:40:0,
                 from ./object.h:40,
                 from dsr/dsragent.cc:49:
./config.h:99:0: warning: "STRTOI64_FMTSTR" redefined [enabled by default]
/home/linxiaoyuan/ns-allinone-2.1b8a/tclcl-1.18/tclcl-config.h:37:0: note: this is the location of the previous definition
In file included from ./mac.h:46:0,
                 from dsr/dsragent.cc:56:
./route.h:46:0: warning: "INFINITY" redefined [enabled by default]
/usr/include/i386-linux-gnu/bits/inf.h:27:0: note: this is the location of the previous definition
In file included from ./agent.h:41:0,
                 from dsr/dsragent.cc:50:
./packet.h: In constructor ‘p_info::p_info()’:
./packet.h:151:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:152:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:153:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:154:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:155:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:156:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:157:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:158:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:159:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:160:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:161:23: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:162:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:163:21: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:164:22: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:165:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:166:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:167:25: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:168:29: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:169:29: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:170:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:172:22: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:173:21: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:174:22: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:175:23: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:176:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:177:21: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:179:21: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:180:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:181:21: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:182:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:183:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:184:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:185:27: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:186:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:187:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:188:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:189:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:190:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:191:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:192:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:194:24: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:195:23: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:197:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:198:23: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:199:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:202:21: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:205:26: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:208:19: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:211:33: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:214:25: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:217:24: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./packet.h:219:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::dropSendBuff(SRPacket&)’:
dsr/dsragent.cc:190:44: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::stickPacketInSendBuffer(SRPacket&)’:
dsr/dsragent.cc:206:46: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘virtual int DSRAgent::command(int, const char* const*)’:
dsr/dsragent.cc:416:53: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:420:55: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:424:55: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:428:54: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘virtual void DSRAgent::recv(Packet*, Handler*)’:
dsr/dsragent.cc:589:21: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::handlePktWithoutSR(SRPacket&, bool)’:
dsr/dsragent.cc:674:49: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:683:36: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::handleForwarding(SRPacket&)’:
dsr/dsragent.cc:767:42: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:777:57: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::handleRouteRequest(SRPacket&)’:
dsr/dsragent.cc:816:31: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:843:31: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:854:22: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:869:58: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘bool DSRAgent::replyFromRouteCache(SRPacket&)’:
dsr/dsragent.cc:967:61: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:1009:23: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::sendOutPacketWithRoute(SRPacket&, bool, Time)’:
dsr/dsragent.cc:1053:65: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:1069:29: error: ‘XmitFailureCallback’ was not declared in this scope
dsr/dsragent.cc:1085:70: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::getRouteForPacket(SRPacket&, ID, bool)’:
dsr/dsragent.cc:1188:54: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::sendOutRtReq(SRPacket&, int)’:
dsr/dsragent.cc:1229:57: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::returnSrcRteForOutsideDomainToRequestor(SRPacket&)’:
dsr/dsragent.cc:1305:44: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::returnSrcRouteToRequestor(SRPacket&)’:
dsr/dsragent.cc:1368:44: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::acceptRouteReply(SRPacket&)’:
dsr/dsragent.cc:1397:73: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:1419:20: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:1460:31: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::processBrokenRouteError(SRPacket&)’:
dsr/dsragent.cc:1502:43: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:1532:55: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘virtual void DSRAgent::tap(const Packet*)’:
dsr/dsragent.cc:1589:66: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:1598:53: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:1615:34: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::sendRouteShortening(SRPacket&, int, int)’:
dsr/dsragent.cc:1704:78: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:1752:16: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::undeliverablePkt(Packet*, int)’:
dsr/dsragent.cc:1887:47: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:1897:58: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:1907:57: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc: In member function ‘void DSRAgent::xmitFailed(Packet*)’:
dsr/dsragent.cc:1934:80: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:1938:63: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:1946:61: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:2005:22: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:2021:18: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
dsr/dsragent.cc:2040:28: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
make: *** [dsr/dsragent.o] Error 1












进入/dsr/dsragent.cc


+void XmitFailureCallback(Packet *pkt, void *data);
/*===========================================================================
  SendBuf management and helpers
  
  ==========================
  
  t*, nsaddr_t, int, bool)’:
diffusion/diffusion.cc:404:26: 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",
================
diffusion/omni_mcast.cc: In member function ‘void OmniMcastAgent::MACprepare(Packet*, nsaddr_t, unsigned int, bool)’:
diffusion/omni_mcast.cc:367:26: error: ‘OmniMcastXmitFailedCallback’ was not declared in this scope
make: *** [diffusion/omni_mcast.o] Error 1




#include "god.h"
+void OmniMcastXmitFailedCallback(Packet *pkt, void *data);
static class OmniMcastClass : public TclClass {


==========================
In file included from tfrc-sink.cc:40:0:
tfrc-sink.h: At global scope:
tfrc-sink.h:74:2: error: a class-key must be used when declaring a friend
tfrc-sink.h:74:2: error: friend declaration does not name a class or function
tfrc-sink.cc: In member function ‘virtual void TfrcNackTimer::expire(Event*)’:
tfrc-sink.cc:296:6: error: ‘void TfrcSinkAgent::nextpkt(double)’ is protected
tfrc-sink.cc:403:16: error: within this context
make: *** [tfrc-sink.o] Error 1




friend +class 
=================




[-Wwrite-strings]
rio.cc: In member function ‘virtual void RIOQueue::trace(TracedVar*)’:
rio.cc:562:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
rio.cc:563:38: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
rio.cc:564:39: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
rio.cc:565:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
rio.cc:566:39: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
rio.cc:567:40: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
rio.cc:568:36: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
make: *** [rio.o] Error 1




patch file: ns-allinone-2.27/ns-2.27/queue/rio.cc


RIOQueue::trace(TracedVar* v)
{
- char wrk[500], *p;
+ char wrk[500];
+ char* p;
- if (((p = strstr(v->name(), "ave")) == NULL) &&
-    ((p = strstr(v->name(), "in_ave")) == NULL) &&
-    ((p = strstr(v->name(), "out_ave")) == NULL) &&
-    ((p = strstr(v->name(), "prob")) == NULL) &&
-    ((p = strstr(v->name(), "in_prob")) == NULL) &&
-    ((p = strstr(v->name(), "out_prob")) == NULL) &&
-    ((p = strstr(v->name(), "curq")) == NULL)) {
+ if (((p = const_cast <char*> (strstr(v->name(), "ave"))) == NULL) &&
+    ((p = const_cast <char*> (strstr(v->name(), "in_ave"))) == NULL) &&
+    ((p = const_cast <char*> (strstr(v->name(), "out_ave"))) == NULL) &&
+    ((p = const_cast <char*> (strstr(v->name(), "prob"))) == NULL) &&
+    ((p = const_cast <char*> (strstr(v->name(), "in_prob"))) == NULL) &&
+    ((p = const_cast <char*> (strstr(v->name(), "out_prob"))) == NULL) &&
+    ((p = const_cast <char*> (strstr(v->name(), "curq"))) == NULL)) {
fprintf(stderr, "RIO:unknown trace var %s\n",
v->name());
return;
}
=======================


[-Wwrite-strings]
tcp-sack-rh.cc: At global scope:
tcp-sack-rh.cc:68:15: error: extra qualification ‘SackRHTcpAgent::’ on member ‘newack’ [-fpermissive]
make: *** [tcp-sack-rh.o] Error 1






patch file: ns-allinone-2.27/ns-2.27/tcp/tcp-sack-rh.cc


- virtual void SackRHTcpAgent::newack(Packet* pkt);
+ virtual void newack(Packet* pkt);
===============
.1b8a/otcl-1.0a7 -I/home/linxiaoyuan/ns-allinone-2.1b8a/include -I/home/linxiaoyuan/ns-allinone-2.1b8a/include -o mpls/ldp.o mpls/ldp.cc
mpls/ldp.cc:47:22: fatal error: iostream.h: No such file or directory
compilation terminated.
make: *** [mpls/ldp.o] Error 1




-#include <iostream.h>
+#include <iostream>
+using namespace std;
==================
l -lm 
simulator.o: In function `Simulator::populate_hier_classifiers()':
simulator.cc:(.text+0x3d8): undefined reference to `RouteLogic::elements_in_level(int*, int)'
simulator.cc:(.text+0x518): undefined reference to `RouteLogic::elements_in_level(int*, int)'
collect2: ld returned 1 exit status
make: *** [ns] Error 1


I am giving u a workaround, I solved it this way, but I really didn't
like it. 


RouteLogic::elements_in_level(int*, int) is an inline function in
route.h, if you prevent it from being inline, i.e. remove the inline
keyword & move the method defn to route.cc, then it will compile, I
really didn't understand why its defn was not available outside route.o,
if you do 'nm route.o', with ur current status you will find it as
'UNDEF', I didn't understand why, normally it shouldn't show as UNDEF
but as GLOBAL, I don't know if this is due to some compiler
"over-optimizations" :-)


Gautam
============================


sudo make  完成

 nam不能用 报错


 

 
 http://hi.baidu.com/lijinli0405/item/998bcf797978394b0c0a0765
 参考上面链接的
 现在找到的方法不是很明白,所以并不奏效:
::::


由于nam调用的tk组件和xproto-7.0.13不兼容导致的(xproto-7.0.13 新添加了GenericEvent)。


有了原因就有解决方法了,看了网上的解决方法,都说的不清不楚,网上说(以下是原话)





可以到这里下载补丁http://bugs.gentoo.org/show_bug.cgi?id=225999
或者新建一个记事本复制一下内容到里面,保存,命名为“tk-8.4.18-tkBind.patch”(将.txt后缀名改为.patch)
--- tk8.4.18-orig/generic/tkBind.c 2006-07-21 08:26:54.000000000 +0200
+++ tk8.4.18/generic/tkBind.c 2008-07-05 12:17:10.000000000 +0200
@@ -586,6 +586,9 @@
/* ColormapNotify */       COLORMAP,
/* ClientMessage */       0,
/* MappingNotify */       0,
+#ifdef GenericEvent
+ /* GenericEvent */      0,
+#endif
/* VirtualEvent */        VIRTUAL, 
/* Activate */             ACTIVATE, 
/* Deactivate */           ACTIVATE,





我按照上述方法试了一下,没有成功,很郁闷。后来经过一段时间的摸索,终于成功了,原来


http://bugs.gentoo.org/show_bug.cgi?id=225999这里的#comment2是其所说的补丁


然后我按其说的建个文档输入上树内容,打补丁,出现了一些错误


后来学习了下patch的用法于patch文件的语法,终于有了点头脑(见我的转载文章:转载Linux下patch的制作和应用)


原来作者的意思就是在tk-8.4.14/generic/tbBind.c的第588行添加:


#ifdef GenericEvent
/* GenericEvent */      0,
#endif


后来我就干脆不用补丁了,而是自己手动修改。


然后重新安装就可以了!就这么简单。
how to reinstall it?

cd /home/user1/jack/ns-allinone-2.33/$sudo ./install   #开始安装


..............................OMG!


开始吧






=============
checking for dlopen in -ldl... yes
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating autoconf.h
config.status: autoconf.h is unchanged
rm -f nam
g++   -o nam \
tkcompat.o tkUnixInit.o xwd.o netview.o netmodel.o edge.o packet.o node.o main.o trace.o queue.o drop.o animation.o agent.o feature.o route.o transform.o paint.o state.o monitor.o anetmodel.o random.o rng.o view.o graphview.o netgraph.o tracehook.o lan.o psview.o group.o editview.o tag.o address.o animator.o wnetmodel.o nam_stream.o enetmodel.o testview.o parser.o trafficsource.o lossmodel.o queuehandle.o gen/version.o gen/nam_tcl.o  -L/home/linxiaoyuan/ns-allinone-2.1b8a/tclcl-1.18 -ltclcl -L/home/linxiaoyuan/ns-allinone-2.1b8a/otcl-1.12 -lotcl -L/home/linxiaoyuan/ns-allinone-2.1b8a/lib -ltk8.4 -L/home/linxiaoyuan/ns-allinone-2.1b8a/lib -ltcl8.4 -L/usr/local/lib -lz -lXext -lX11 -lnsl -ldl -lm 
Nam has been installed successfully.
Please compile your xgraph separately.
Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.4.13: /home/linxiaoyuan/ns-allinone-2.1b8a/{bin,include,lib}
tk8.4.13: /home/linxiaoyuan/ns-allinone-2.1b8a/{bin,include,lib}
otcl: /home/linxiaoyuan/ns-allinone-2.1b8a/otcl-1.12
tclcl: /home/linxiaoyuan/ns-allinone-2.1b8a/tclcl-1.18
ns: /home/linxiaoyuan/ns-allinone-2.1b8a/ns-2.1b8a/ns
nam: /home/linxiaoyuan/ns-allinone-2.1b8a/nam-1.12/nam
gt-itm:   /home/linxiaoyuan/ns-allinone-2.1b8a/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns


----------------------------------------------------------------------------------


Please put /home/linxiaoyuan/ns-allinone-2.1b8a/bin:/home/linxiaoyuan/ns-allinone-2.1b8a/tcl8.4.13/unix:/home/linxiaoyuan/ns-allinone-2.1b8a/tk8.4.13/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.


IMPORTANT NOTICES:


(1) You MUST put /home/linxiaoyuan/ns-allinone-2.1b8a/otcl-1.12, /home/linxiaoyuan/ns-allinone-2.1b8a/lib, 
    into your LD_LIBRARY_PATH environment variable.
    If it complains about X libraries, add path to your X libraries 
    into LD_LIBRARY_PATH.
    If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH <paths>
    If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>


(2) You MUST put /home/linxiaoyuan/ns-allinone-2.1b8a/tcl8.4.13/library into your TCL_LIBRARY environmental
    variable. Otherwise ns/nam will complain during startup.


(3) [OPTIONAL] To save disk space, you can now delete directories tcl8.4.13 
    and tk8.4.13. They are now installed under /home/linxiaoyuan/ns-allinone-2.1b8a/{bin,include,lib}


After these steps, you can now run the ns validation suite with
cd ns-2.1b8a; ./validate


For trouble shooting, please first read ns problems page 
http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts.




完成 








  
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值