title: Why is "multiple definition of" error coming up, when I have only defined each of the specified variables once in source.h?
body: <p>I am developing a program to read NFC cards, and I have a header file, source.h, holding all the variables for use in it's related source code, source.c. A sample is as shown below:</p>
  
  <pre><code>#ifdef __cplusplus
  extern "C" {
  #endif
  
  int SDA_SUPPORT_PRESENT = 0;
  int DDA_SUPPORT_PRESENT = 0;
  int CDA_SUPPORT_PRESENT = 0;
  int CARDHOLDER_VERIFICATION_PRESENT = 0;
  ...
  </code></pre>
  
  <p>The source code, source.c, holds the methods utilizing the above defined variables. A sample is as shown:</p>
  
  <pre><code>#include &lt;source.h&gt;
  
  extern void translateError(uint8 error, int slot) //one of the methods
  {
      TP_DbgSerialPrn("\n\rDevice Error: ");
      switch(error)
      {
  ...
  </code></pre>
  
  <p>I also have a source file, CardReader.c, which calls the methods included in source.c, and which has a related header file, CardReader.h. The issue is, when I include the source.h file in the CardReader.h file, i get the following error:</p>
  
  <pre><code>../CardReader.o:(.bss+0x12b4): first defined here
  ../source.o:(.bss+0x12b8): multiple definition of `SLOT_NUMBER'
  ../CardReader.o:(.bss+0x12b8): first defined here
  ../source.o:(.data+0x49): multiple definition of `LISTED_APPLICATION_IDS'
  ../CardReader.o:(.data+0x49): first defined here
  ../source.o:(.data+0xc9): multiple definition of `LISTED_APPLICATION_IDS_LENGTH'
  </code></pre>
  
  <p>All the rest of the error messages are of the same type. The source.h file is included as indicated in CardReader.h:</p>
  
  <pre><code>#include &lt;TPCardReader.h&gt; 
  #include &lt;source.h&gt;
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  ...
  </code></pre>
  
  <p>with the path variables set properly, so it can be found, and then called the CardReader.h file as usual in CardReader.c. My question is why is that error coming up, yet I have only defined each of the specified variables once in source.h? Is there something am missing or not doing or do I not understand the error?</p>