On Sunday 20 Jan 2008 9:35:53 pm Frederic Bouvier wrote:
> kitts a écrit :
> > In my experimentation i have added a class and in its class and im trying
> > to tie one of its member variables to the property tree so that the user
> > can read and modify its value. In the constructor i am using the code;
> >
> >     fgTie("/path/to/my/var", this,
> >           &MyClass::getter,
> >           &MyClass::setter);
> >
> > getter and setter are member functions defined in the class header;
> >
> >         int getter(){return m_value;}
> >         void setter(int value){m_value = value;}
> >
> > When compiling i get the following error:
> >
> > error: no matching function for call to ‘fgTie(const char [16], MyClass*
> > const, int (MyClass::*)(), void (MyClass::*)(int))’
> >
> > What am i doing wrong? What is the right method to achieve what i intend?
> > I have included <Main/fg_props.hxx>
> >  
>
> try :
>
>         int getter()    const         {return m_value;}
>         void setter(int value){m_value = value;}

Thanks Fred. That did it. I must learn to interpret gcc's error messages 
better than i now do! :-)
-- 
Cheers!
kitts

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to