title: C Programming Error: undefined symbol to a struct (Keil error L6218E)
body: <p>I am using Keil MDK ARM to develop a project. However, when I am trying to build my code, the software tool throws the ERROR: L6218E : Undefined symbol Bit (referred from main.o).
  Where Bit is a struct that I am using to store boolean values. For eg:</p>
  
  <p><strong>In variable.h file</strong></p>
  
  <pre><code>struct
  {
      unsigned bPowerONStatus : 1;
      unsigned bTimerONStatus : 1;
  } extern Bit;
  </code></pre>
  
  <p><strong>In main.c file:</strong></p>
  
  <pre><code>#include variable.h
  
  int main()
  {
      while(1)
      {
          ReadTimerStatus();
          if(Bit.bPowerONStatus)
          {
              // System is ON
          }
          else
          {
              // System if OFF
          }
      }
  }
  </code></pre>
  
  <p><strong>In PowerChecker.c file</strong></p>
  
  <pre><code>#include variable.h
  
  void ReadTimerStatus(void)
  {
      if(Bit.bTimerONStatus)
      {
          Bit.bPowerONStatus = 1;
      }
      else
      {
          Bit.bPowerONStatus = 0;
      }
  }
  
  </code></pre>
  
  <p>What am I doing wrong here? What is the correct method of defining a struct, that will be used in multiple source files?</p>