I have a problem with Duplicate Definition error. I have to write a constant inside an header file which is called by other files, but that error occurs and I don't know how to resolve it. I try to use an include guard, but it doesn't work.
#ifndef _DEFINE_PORTS__H___INCLUDED
#define _DEFINE_PORTS__H___INCLUDED
#define GPIO_SWPWM_PORT GPIOB
const uint16_t GPIO_SWPVM_LEDS[12] = {GPIO_Pin_0 , GPIO_Pin_1 , GPIO_Pin_2 ,
GPIO_Pin_3 , GPIO_Pin_4 , GPIO_Pin_5 ,
GPIO_Pin_6 , GPIO_Pin_7 , GPIO_Pin_8 ,
GPIO_Pin_10 , GPIO_Pin_12 , GPIO_Pin_14};
#endif // _DEFINE_PORTS__H___INCLUDED
Following the error (there are more like this);
Error[Li006]: duplicate definitions for "GPIO_SWPVM_LEDS"; in "C:\Andrea\Dev\stm32\ew\Debug\Obj\App.o", and "C:\Andrea\Dev\stm32\ew\Debug\Obj\AppEeprom.o"