About Finitie State Machine class implementation method

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Warren
Posts: 60
Joined: Fri Jul 07, 2006 11:41 pm
Location: Santiago De Compostela, Spain

Post by Warren »

well, here you got the simple aplication source code (with Dev-cpp and C::B project files)

http://download2-5.files-upload.com/200 ... obaFSM.rar


Thx for testing it
------------------------------------------------
Irrlicht Ussers Map
Join now!!
http://www.frappr.com/irrlichtusers
Warren
Posts: 60
Joined: Fri Jul 07, 2006 11:41 pm
Location: Santiago De Compostela, Spain

Post by Warren »

wow wow, look what i found from the GCC FAQ:
When building C++, the linker says my constructors, destructors or virtual tables are undefined, but I defined them

The ISO C++ Standard specifies that all virtual methods of a class that are not pure-virtual must be defined, but does not require any diagnostic for violations of this rule [class.virtual]/8. Based on this assumption, GCC will only emit the implicitly defined constructors, the assignment operator, the destructor and the virtual table of a class in the translation unit that defines its first such non-inline method.

Therefore, if you fail to define this particular method, the linker may complain about the lack of definitions for apparently unrelated symbols. Unfortunately, in order to improve this error message, it might be necessary to change the linker, and this can't always be done.

The solution is to ensure that all virtual methods that are not pure are defined. Note that a destructor must be defined even if it is declared pure-virtual

so i was´nt defining the virtual method at all.
I just replace this line at the State class definition :

virtual void Evalue();

for this one

virtual void Evalue(){};

and that is all!! ´cos i dont need any definition at base class at all, even without the virtual destructor it works ( i´ll keep it xD)

Thx both for help at this (dumb?) situation,
now i´m ready to begin my Finite State Machine......

(PD: I feel like i could....like i could...TAKE ON THE WORLD :roll: )
------------------------------------------------
Irrlicht Ussers Map
Join now!!
http://www.frappr.com/irrlichtusers
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

BTW, ditch the ; at the end of virtual void Evalue(){};
{} already says beginning and end, having a ; is the equivalent of an empty expression, like writtin 6; on one line of your code...
Post Reply