 <p>Since <code>friend</code> relationships aren't inherited, you need to declare <code>convertF</code> as a friend of both classes. But you need this only if the function needs access the internals of these classes - are you sure the public interface of the classes doesn't suffice?</p> <p>One further reason to try to avoid such a double friend is that it would create a circular dependency between these classes via the signature of <code>convertF</code>. </p> <p><strong>Update:</strong> This is exactly why you can't declare your friend function the way you show above. For this to work, the compiler would need to know the full definition of <code>iFraction</code> while it is still not finished with the definition of the base class <code>Fraction</code>, which is impossible.</p> <p>Technically it could work the other way around, by forward declaring <code>iFraction</code>. Although I still wouldn't consider it a good solution. Are you sure your class hierarchy is right?</p>