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

Re: [ns] any1 know about Error: type `TclObject' is not a base type?



Hi,

The function should be:
TclObject* create(int, const char*const*) {
return (new PassTcpAgent());
}

yours
X. Cao

M. Ali Baig wrote:

> Hi,
> 
> I need to write my own TCP agent. This agent need to change only the 
> output function w.r.t original.
> In tcp.h file I have declared it like:
> 
> 
> class PassTcpAgent : public virtual TcpAgent {
> public:
>      PassTcpAgent();
>      virtual void output(int seqno, int reason = 0);
> 
> };
> 
> 
> 
> In my tcp-pass.cc file it is
> 
> static class PassTcpClass : public TclClass {
> public:
>  PassTcpClass() : TclClass("Agent/TCP/PassTcp") {}
>  TclObject* create(int, const char*const*) {  //**** Error line
>    return (new PassTcpClass());
>   }
> } class_pass;
> 
> and there is output funtion .....
> When I try to make, it gives me following error
> Error:
> 
> 
> tcp-pass.cc: In method `class TclObject * PassTcpClass::create(int, 
> const char *const *)':
> tcp-pass.cc:19: type `TclObject' is not a base type for type `PassTcpClass'
> make: *** [tcp-pass.o] Error 1
> 
> 
> Can any one tell why the error is?
> 
> Muhammad Ali Baig
> 
> 
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp