You must either a) define the int hdr_akisprotocol_pkt::offset_ global variable in your code. Check /common/packet.h for more details or b) use the #define OFFSET(type, field) macro to do the same trick this must be explained in the ns2 manual in the part of creating new headers also check: http://www.isi.edu/nsnam/ns/tutorial/nsnew.html#first in this part: "The int 'off_ping_' will be used to access a packet's ping header." Pedro Vale Estrela > -----Original Message----- > From: Ioakeim Samaras [mailto:[EMAIL PROTECTED] > Sent: quarta-feira, 21 de Março de 2007 11:02 > To: Pedro Estrela > Subject: Error in Object!! > > Hello. I would like to thank you for your help. I read carefully the pdf > file from the location : > http://masimum.dif.um.es/nsrt-howto/pdf/nsrt-howto.pdf > I followed all the steps described there for making my own protocol. I > named the protocol instead of protoname, akisprotocol. I tried to > compile it, and the compiler could not continue because of some small > errors in the C++ code. I correct all that errors and I compile it again > in both ns-2.27 and ns-2.30. But now the compiler says that there exist > errors in object files. More specific, in both ns-2.27 and ns-2.30, > after executing : touch common/packet.cc , make , I receive the > following message : > > trace/cmu- > trace.o(.gnu.linkonce.t._ZN20hdr_akisprotocol_pkt6accessEPK6Packet+0xb): > In function `hdr_akisprotocol_pkt::access(Packet const*)':: undefined > reference to `hdr_akisprotocol_pkt::offset_' > akisprotocol/akisprotocol.o(.gnu.linkonce.t._ZN23akisprotocolHeaderClassC1 > Ev+0x28): > In function > `akisprotocolHeaderClass::akisprotocolHeaderClass[in-charge]()':: > undefined reference to `hdr_akisprotocol_pkt::offset_' > collect2: ld returned 1 exit status make: *** [ns] Error 1 > > I also executed : configure, make clean, make , but still it finds the > same errors. > > I don't know how to solve this problem. Previously the compiler found > errors in .cc and .h files which I corrected them all. But now it > finds errors in object files(.o). > I am quite disappointed. Can you help me please? Any help would be > appreciated. Thank you. > > ---------------------------------------------------------------------- > Need cash? Apply now for a credit loan with fast approval > http://tags.bluebottle.com/fc/CAaCMPJkvYIjBVjuielxhxyKD5MUIXe4/