hello
i make some change in a ping example in order to try to compile a new protocol 
, but it doesn't  work i don't know why !!
i've  only create new files myping.cc myping.h myping.tcl i put them in 
ns-2.33/apps, and i've  replace  only ping by myping in all class for example 
in myping.h 

#ifndef ns_myping_h
#define ns_myping_h

#include "agent.h"
#include "tclcl.h"
#include "packet.h"
#include "address.h"
#include "ip.h"


struct hdr_myping {
  char ret;
  char nbhop;
  double send_time;
};


class myPingAgent : public Agent {
 public:
  myPingAgent();
  int command(int argc, const char*const* argv);
  void recv(Packet*, Handler*);
 protected:
  int off_myping_;
};


#endif

i did all the necessary changement in 
tcl/lib/default.tcl, common/packet.h..............and in Makefile i add 
apps/myping.o
 tell me plz if i have to create myping.o or it's automaticly generated
i run ./configure 
but when i run make oooooooooooh my dearest god a lot of error , i'm dispointed 
look in to that :


configure: creating ./config.status
config.status: creating Makefile
config.status: creating tcl/lib/ns-autoconf.tcl
config.status: creating indep-utils/webtrace-conv/ucb/Makefile
config.status: creating indep-utils/webtrace-conv/dec/Makefile
config.status: creating indep-utils/webtrace-conv/nlanr/Makefile
config.status: creating indep-utils/webtrace-conv/epa/Makefile
config.status: creating indep-utils/cmu-scen-gen/setdest/Makefile
config.status: creating autoconf.h
config.status: autoconf.h is unchanged
sa...@sarym-laptop:~/Bureau/ns-allinone-2.33/ns-2.33$ make
g++ -c -Wall  -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR  -DNDEBUG 
-DLINUX_TCP_HEADER -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_13 
-DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCL_H  
-DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=std 
-DUSE_SINGLE_ADDRESS_SPACE -Drng_test  -I. -I. 
-I/home/sarym/Bureau/ns-allinone-2.33/tclcl-1.19 
-I/home/sarym/Bureau/ns-allinone-2.33/otcl 
-I/home/sarym/Bureau/ns-allinone-2.33/include 
-I/home/sarym/Bureau/ns-allinone-2.33/include -I/usr/include/pcap -I./tcp 
-I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac -I./mobile 
-I./trace -I./routing -I./tools -I./classifier -I./mcast 
-I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr 
-I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs -I./diffserv 
-I./satellite -I./wpan -o apps/myping.o apps/myping.cc
In file included from ./common/agent.h:41,
                 from apps/myping.h:12,
                 from apps/myping.cc:10:
./common/packet.h: In static member function ‘static void p_info::initName()’:
./common/packet.h:287: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:288: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:289: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:290: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:291: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:292: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:293: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:294: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:295: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:296: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:297: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:298: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:299: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:300: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:301: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:302: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:303: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:304: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:305: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:306: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:308: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:309: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:310: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:311: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:312: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:313: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:315: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:316: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:317: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:318: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:319: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:320: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:321: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:322: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:323: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:324: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:325: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:326: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:327: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:328: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:330: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:331: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:333: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:334: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:335: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:337: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:340: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:343: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:346: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:349: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:352: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:355: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:359: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:363: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:364: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:366: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:367: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:370: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:373: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:376: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:379: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:383: warning: deprecated conversion from string constant to 
‘char*’
./common/packet.h:385: warning: deprecated conversion from string constant to 
‘char*’
apps/myping.cc: At global scope:
apps/myping.cc:15: error: ISO C++ forbids declaration of ‘PingHeaderClass’ with 
no type
apps/myping.cc: In member function ‘int myPingHeaderClass::PingHeaderClass()’:
apps/myping.cc:15: error: only constructors take base initializers
apps/myping.cc:16: error: ‘hdr_ping’ was not declared in this scope
apps/myping.cc:16: warning: no return statement in function returning non-void
apps/myping.cc: At global scope:
apps/myping.cc:22: error: ISO C++ forbids declaration of ‘PingClass’ with no 
type
apps/myping.cc: In member function ‘int myPingClass::PingClass()’:
apps/myping.cc:22: error: only constructors take base initializers
apps/myping.cc:22: warning: no return statement in function returning non-void
apps/myping.cc: In constructor ‘myPingAgent::myPingAgent()’:
apps/myping.cc:31: error: ‘amp’ was not declared in this scope
apps/myping.cc:31: error: expected `;' before ‘)’ token
apps/myping.cc:31: warning: statement has no effect
apps/myping.cc:33: error: expected `;' before ‘)’ token
apps/myping.cc:33: warning: statement has no effect
apps/myping.cc: In member function ‘virtual int myPingAgent::command(int, const 
char* const*)’:
apps/myping.cc:44: error: ‘gt’ was not declared in this scope
apps/myping.cc:44: error: ‘access’ was not declared in this scope
apps/myping.cc:47: error: ‘ret’ was not declared in this scope
apps/myping.cc:49: error: ‘send_time’ was not declared in this scope
apps/myping.cc: At global scope:
apps/myping.cc:63: error: ‘PingAgent’ has not been declared
apps/myping.cc: In function ‘void recv(Packet*, Handler*)’:
apps/myping.cc:66: error: ‘gt’ was not declared in this scope
apps/myping.cc:66: error: ‘off_ip_’ was not declared in this scope
apps/myping.cc:66: error: ‘access’ was not declared in this scope
apps/myping.cc:68: error: ‘off_myping_’ was not declared in this scope
apps/myping.cc:70: error: expected `)' before ‘;’ token
apps/myping.cc:70: error: ‘ret’ was not declared in this scope
apps/myping.cc:70: error: expected `;' before ‘)’ token
apps/myping.cc:85: error: ‘else’ without a previous ‘if’
apps/myping.cc:94: error: ‘name’ was not declared in this scope
apps/myping.cc:95: error: ‘src_’ was not declared in this scope
apps/myping.cc:96: error: invalid operands of types ‘double’ and ‘hdr_myping*’ 
to binary ‘operator-’
apps/myping.cc:96: error: expected `)' before ‘;’ token
apps/myping.cc:96: error: ‘send_time’ was not declared in this scope
apps/myping.cc:96: error: expected `;' before ‘)’ token
apps/myping.cc:97: error: ‘amp’ declared as reference but not initialized
apps/myping.cc:97: error: ‘tcl’ was not declared in this scope
apps/myping.cc:97: warning: unused variable ‘amp’
apps/myping.cc: In constructor ‘myPingHeaderClass::myPingHeaderClass()’:
apps/myping.cc:13: error: no matching function for call to 
‘PacketHeaderClass::PacketHeaderClass()’
./common/packet.h:638: note: candidates are: 
PacketHeaderClass::PacketHeaderClass(const char*, int)
./common/packet.h:636: note:                 
PacketHeaderClass::PacketHeaderClass(const PacketHeaderClass&)
apps/myping.cc: At global scope:
apps/myping.cc:17: note: synthesized method 
‘myPingHeaderClass::myPingHeaderClass()’ first required here 
apps/myping.cc: In constructor ‘myPingClass::myPingClass()’:
apps/myping.cc:20: error: no matching function for call to 
‘TclClass::TclClass()’
/home/sarym/Bureau/ns-allinone-2.33/tclcl-1.19/tclcl.h:275: note: candidates 
are: TclClass::TclClass(const char*)
/home/sarym/Bureau/ns-allinone-2.33/tclcl-1.19/tclcl.h:270: note:               
  TclClass::TclClass(const TclClass&)
apps/myping.cc: At global scope:
apps/myping.cc:26: note: synthesized method ‘myPingClass::myPingClass()’ first 
required here 
make: *** [apps/myping.o] Error 1


so please help meeeeeeeeeeeeee!!!!




_________________________________________________________________
Découvrez Windows Live Spaces et créez votre site Web perso en quelques clics !
http://spaces.live.com/signup.aspx

Reply via email to