title: Extern typedefs in C
body: <p>I have 4 files:  </p>
  
  <p>a.h:</p>
  
  <pre><code>typedef struct {
      int a;
  } A;
  </code></pre>
  
  <p>b.h:</p>
  
  <pre><code>#include "a.h"
  typedef struct {
      A a;
      int b;
  } B;
  </code></pre>
  
  <p>c.h:</p>
  
  <pre><code>#include "a.h"
  typedef struct {
      A a;
      double c;
  } C;
  </code></pre>
  
  <p>d.c:</p>
  
  <pre><code>#include "b.h"
  #include "c.h"
  //Here I want to use types A, B and C
  </code></pre>
  
  <p>int and double are only examples, the real problem I have is far more complex.<br>
  The point is that it should be possible to convert types B and C to A by simply casting to it.<br>
  The issue I´m fighting is that it says type A is included multiple times, which is comprehensible because d.c includes b.h which includes a.h, but a.h is also included by c.h.<br>
  Is there a way to do that?</p>