title: Multiple definition collect2: error: ld returned 1 exit status in C
body: <p>Process_struct.h //header file</p>
  
  <pre><code>#define MAX_PROCS 5
  #define EXIT 1
  #define TRUE 1
  /*******************************/
  FILE *file=NULL;
  /*******************************/
  static FILE *outLog=NULL;
  pthread_t producer;//Producer Thread ID
  pthread_t consumer[MAX_PROCS];//consumer thread ID
  </code></pre>
  
  <p>This is the error I get when I go to run my Makefile:</p>
  
  <pre><code>    /tmp/ccvDJUQI.o:(.bss+0x8): multiple definition of `file'
      /tmp/cc4RWdZ4.o:(.bss+0x8): first defined here
      collect2: error: ld returned 1 exit status
      make: *** [Multiprocessor] Error 1
  </code></pre>
  
  <p>The build tells me that I have multiple definition of <code>file</code> in my program. Well the only section that I'm calling my file is in my header file. With my header file code above, there is no multiple definition of <code>file</code> in the file. The <code>file</code> is used throughout both of my .c program files but is only appears in my header file as a variable. I'm not sure why this error appears. Can anyone help me with fixing this error?</p>