Wednesday, November 30, 2011

Re: [ns] warning: no class variable

HI,

Check your variable name. It should be var_myAgent, not var_mainAgent.

Best Regards,

Teerawat Issariyakul
http://www.ns2ultimate.com/
http://www.facebook.com/pages/Teerawat-Issariyakul/358240861417
http://twitter.com/T_Bear
http://www.t-issariyakul.blogspot.com
http://www.ece.ubc.ca/~teerawat
On Nov 30, 2011, at 7:23 PM, K. M. wrote:

>
>
> Hi all,
>
>
> I defined the following agent
>
>
> Main_Agent::Main_Agent() : Agent(PT_UDP) {
> ...
> bind("var_mainAgent", &var_mainAgent);
> ...
> }
>
>
> I also defined the following agent which inherits from the previous
>
>
> My_Agent::My_Agent() : Main_Agent() {
> ...
> bind("var_myAgent", &var_myAgent);
> ...
> }
>
>
>
> When I execute my file I get the following message
>
>
> warning: no class variable Agent/My_Agent :: var_mainAgent
>
>
> I believe this is because the Main_Agent's constructor is not executed when I call the My_Agent's constructor. How do I solve this?
>
>
> Kind Regards
>
>

No comments:

Post a Comment

Counter

blogger analytics