Process_struct.h //header file
#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
This is the error I get when I go to run my Makefile:
/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
The build tells me that I have multiple definition of file
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 file
in the file. The file
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?