Essentially what you're trying to do is:
class A
{
A a;
};
int main()
{
A a;
return 0;
}
(You can see that this produces the same error here)
This is infinite recursion, you're defining a type using itself. Take a pointer instead, like so:
class A
{
A* a;
};
int main()
{
A a;
return 0;
}
As you can see here this compiles.