Class overview, etc. my interface!
Animal.H:
class Animal { public: virtual void walk(); }
Animals.CPP
= EMPTY
Cow.H:
class Cow : public Animal { public: virtual void walk(); }
Here you should know that the walk function is taken from the class in which it is displayed on the right? (e.g. Animal ..), when I did not define the walk function, it should say that I have to define it correctly ...?
Cow.CPP:
void Cow::walk() {
SomeOtherClass.H
namespace SomeNamespace { void LetAnimalWalk(); }
SomeOtherClass.CPP
Cow myCow; namespace SomeNamespace { void LetAnimalWalk() { myCow.walk(); } }
Should this work correctly? ... I mean the namespace, "class :: ..."? and how do I inherit and use the interface?
Because in this way I get with EVERY FUNCTION made from the interface, so every virtual function gives me the following error:
SomeOtherClass.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall Cow::Walk (...etc etc...) referenced in function "void __cdecl SomeNamespace::LetAnimalWalk() (...etc etc...)
Does anyone know what I'm doing wrong, what I really find is that it means that I did not declare the function on the right (somewhere in Cow.cpp ??)
Thanks in advance guys
Sebastiaan van dorst
source share