vijitron
Newbie level 6
- Joined
- Feb 22, 2009
- Messages
- 12
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,366
i am using the structure and got this mulitlple definition issue,
Error: (Compiler: XC16 MPLAB X IDE)
build/default/production/drv/CC112X/Drv/Radio.o(.nbss+0x2): multiple definition of `_RadioChipType'
build/default/production/main.o(.nbss+0x0): first defined here
My structure in Radio_if.h file
i included this Radio_if.h file in Radio.c file and the Main.c file.
I added the Radio.c file in source folder of project in Mplab X.
i written the below as well to avoid multiple includes
Can any help me why this error comes in
Error: (Compiler: XC16 MPLAB X IDE)
build/default/production/drv/CC112X/Drv/Radio.o(.nbss+0x2): multiple definition of `_RadioChipType'
build/default/production/main.o(.nbss+0x0): first defined here
My structure in Radio_if.h file
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 typedef struct { unsigned int deviceName; unsigned int id; unsigned int ver; unsigned int xoscFreq; }radioChipType_t; radioChipType_t RadioChipType;
i included this Radio_if.h file in Radio.c file and the Main.c file.
I added the Radio.c file in source folder of project in Mplab X.
i written the below as well to avoid multiple includes
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #ifndef RADIO_IF_H #define RADIO_IF_H #ifdef __cplusplus extern "C" { #endif //codes here #ifdef __cplusplus } #endif #endif
Can any help me why this error comes in