[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] new headers



> >>         static int offset_;     // offset for this header

This is a class static member variable, so you have to declare it global
in your c++ file. Since you did not, the compiler gave that undefined
error. See any example of packet header offset variables; e.g., packet.h
and packet.cc

- Haobo

> >> On compiling, it doesnt give errors. On linking it gives the following it
> >> gives:
> >> 
> >> proto-x.o: In function `hdr_x::offset(void)':
> >> proto-x.o(.hdr_x::gnu.linkonce.t.offset(void)+0x4): undefined reference
> >> to `hdr_x::offset_'
> >> collect2: ld returned 1 exit status
> >> make: *** [ns] Error 1
> >> 
> >> Help will be appreciated
> >> 
> >> Debo
> >
> >--------------------------------------------
> > Eric H. Weigle   CCS-1, RADIANT team
> > [email protected]     Los Alamos National Lab
> > (505) 665-4937   http://home.lanl.gov/ehw/
> >--------------------------------------------
> 
> Tarik 
> 
>