scorrpeio
Full Member level 5
![Full Member level 5](/styles/images/ranks/flevel2.gif)
I have written a code of GSM interface in C for PIC18.
In short the architecture is...
INTERRUPT.h contains the variables as...
I have used these variables in GSM.c file where I included GSM.h.
In GSM.h, I declared above variables as extern...
But when I compile...I get an error...
Error - symbol 'G_ui8_RxBufCnt' has multiple definitions.
I have tried by removing the initialisation at the time of declaration of variables, but it didnt work. I think, there is an issue with extern or #include, but could not trace exactly.
Please tell me, how should I proceed to correct the error
In short the architecture is...
INTERRUPT.h contains the variables as...
Code:
//***uint8_t is typedef of char ***
uint8_t G_ui8_RxBufCnt = 0;
uint8_t G_ui8_RecvBuf[100] = {" "};
I have used these variables in GSM.c file where I included GSM.h.
In GSM.h, I declared above variables as extern...
Code:
extern uint8_t G_ui8_RxBufCnt;
extern uint8_t G_ui8_RecvBuf[100];
But when I compile...I get an error...
Error - symbol 'G_ui8_RxBufCnt' has multiple definitions.
I have tried by removing the initialisation at the time of declaration of variables, but it didnt work. I think, there is an issue with extern or #include, but could not trace exactly.
Please tell me, how should I proceed to correct the error