title: C++ shared libraries with inheritance
body: <p>I have a library (a.so) with a base classes (MyClassA). Another library (b.so) has a class MyClassB that inherits from MyClassA (in a.so). I compile MyClassA.h and MyClassA.cpp isolated in a.so. MyClassB.h and MyClassB.cpp are compiled in isolation (with a reference to MyClassA.h but without adding MyClassA.h to b.so). I then link b.so to a.so.</p>
  
  <p>To summarize:</p>
  
  <ol>
  <li>a.so contains MyClassA.h and MyClassA.cpp</li>
  <li>b.so contains MyClassB.h and MyClassB.cpp</li>
  <li>b.so is linked to a.so</li>
  </ol>
  
  <p>When I try to compile, I get a number of reference errors to MyClassA, caused by b.so.</p>
  
  <p>When I compile b.so and add MyClass.h to it, the library compiles and runs without any errors. Hence:</p>
  
  <ol>
  <li>a.so contains MyClassA.h and MyClassA.cpp</li>
  <li>b.so contains MyClassB.h, MyClassB.cpp AND MyClassA.h</li>
  <li>b.so is linked to a.so</li>
  </ol>
  
  <p>Is it possible in C++ to use my first option, or is it required to always include the base headers in subclass library?</p>