Yeah, that's a toughie. You have two basic options, someone else may know of another.
1) use a forward declaration for one of them, and then use that class as a POINTER (because the compiler knows that such a class exists, but not how big it is or anything like that):
class Classone; // forward
class Classtwo
{
<blah blah blah>
Classone* m_pClassOne;
}; 2) Are they similar enough to have a common superclass? Then you can declare a pointer to the superclass. This only works if one class can call member functions that belong to the superclass:
class super
{
public:
CallMe();
};
class Classone : public super
{
<blah blah blah>
super* m_pClasstwo;
}
class Classtwo : public super
{
<blah blah blah>
super* m_pClassone;
}