title: enum declaration in header file
body: <p>I have files A.c , B.c and B.h .
  In A.c there is an </p>
  
  <pre><code>enum CMD{
      FIRST,
      SECOND,
      THIRD,
  };
  </code></pre>
  
  <p>and later in that file there is</p>
  
  <pre><code>bool function(...){
  //...
  enum CMD data_type = FIRST;
  //...
  }
  </code></pre>
  
  <p>In file B.c I need to use</p>
  
  <pre><code>if (data_type == FIRST){...}
  </code></pre>
  
  <p>I tried to include in B.h this:</p>
  
  <pre><code>extern enum CMD data_type;
  </code></pre>
  
  <p>And included #include "B.h" in A.c and B.c .
  All files are in the propper folders of the project.
  But no cigar :(
  The line in B.c gives this:</p>
  
  <pre><code>20: identifier "FROM_SMS" is undefined
  70: incomplete type is not allowed
  </code></pre>
  
  <p>How do I make this work. The A.c file is writen by someone else and I'm modifiing the code with B.c . The original code is  a mess and I wan to fidlle with it as less as possible :)
  Architecture ie STM32 and I'm using uVision 3 IDE.</p>
  
  <p>Thank you</p>