Possible Duplicate:
The type in a dynamic_cast must be a pointer or reference to a complete class type, or void *
I've got a namespace Fuzzy and it has an abstract class called CuteDog (that inherits from another abstract class).
I'm writing a new class called PuppyArmy
I'd like to have a pointer to a CuteDog in PuppyArmy and in my header file I'm trying this.
namespace Fuzzy { class CuteDog }
using namespace Fuzzy;
class PuppyArmy {
...
CuteDog *cute;
}
then when in my cpp file i've got this
using namespace Tough;
....
cute = dynamic_cast<::Fuzzy::CuteDog*>(foo()); // where foo() returns the parent class of CuteDog*
The compiler is telling me
C2440: '=' : cannot convert from Fuzzy::CuteDog * to PuppyArmy::Fuzzy::CuteDog *
Any pointers to what I'm doing wrong here?