The compiler is complaining about "no appropriate default constructor
available" when I reference a subclass.
The basic setup is that i have a class Test and a subclass called
TestKid. I want to create a TestKid within a function of my Test
class. It gives me this error, though, and I can't figure out why
because I DO have default constructors. Can someone help me out?
Thanks.
all the files:
Test.h
------
class TestKid;
class Test {
public:
void make();
Test();
virtual ~Test();
};
Test.cpp
--------
#include "Test.h"
Test::Test() { }
Test::~Test() { }
void Test::make() { TestKid* t = new TestKid(); }
TestKid.h
---------
#include "Test.h"
class TestKid : public Test {
public:
TestKid();
virtual ~TestKid();
};
TestKid.cpp
-----------
TestKid::TestKid() { }
TestKid::~TestKid() { }
This is puzzling me greatly...