compiler cannot compile inheritance c++ : <p>Suppose i have a header which contain these two classes </p>

<pre><code>class A:public class B{
 // code
};
class B 
{
protected:
A a_object;
};
</code></pre>

<p>when the compiler compiles this include file,when it comes to Class A ,it sees class A inherits from B but it doesn't reach to Class B definition.So it gives an error. and if i reverse the order of both classes,it gives error due to a_object as it doesn't see Class A definition. </p>

<p>So how to solve this problem? and assume that i restricted to this include file to have class A and B definitions.</p>

<p>Thanks</p>
