Original Post
Hi!
I am porting my engine to C++ from C. Almost everything works like I intend it to work, but I''ve got a huge problem when it comes to classes and virtual functions. Okay, here is the big picture (I must add, that I am pretty new to OO development):
I have a class with a virtual function called OnDraw, and I have an inherited class from this one, where I describe the OnDraw function:
class First
{
public:
virtual void OnDraw();
};
class Sec: public First
{
public:
void OnDraw();
};
when I do it like this, there are no problems, I can call Sec->OnDraw and it works. But when I add arguments to the function:
virtual void OnDraw(cCamera cam);
void OnDraw(cCamera cam);
I get a linker error saying unresolved external symbol virtual void OnDraw... okay, so I add a {} instead of ; at the virtual function declaration. The linker now does not give me an error, instead it doesn''t run the inherited class'' function, instead it runs what''s inside of the virtual function''s body. It makes me bald, damn it. Please, I beg you, help me!
Thanks for your time,
Dan Fekete