This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

multiple definition of "something" Segger

Hello every one.

I am new with Segger and nRF52.

I tried to create my own library for OB1203 sensor.

But i stack here when Segger view this error:

Output/blinky_pca10040_s132 Release/Obj/OB1203.o:C:\Users\dang\Desktop\OB1203v1\examples\peripheral\blinky\pca10040\s132\ses/../../../../../../modules/nrfx/drivers/include/OB1203.h:195: multiple definition of `osc_trim'; Output/blinky_pca10040_s132 Release/Obj/main.o:C:\Users\dang\Desktop\OB1203v1\examples\peripheral\blinky\pca10040\s132\ses/../../../../../../modules/nrfx/drivers/include/OB1203.h:195: first defined here
Below is my screen shoot

I believe the way i put OB1203.h and OB1203.c is wrong, that is not relate to Segger or nRF52 but i can not find where it wrong. 

Please help me.

Thank you for any support

Parents
  • Hi

    According to the SEGGER error, it seems that you have defined the same function/variable "osc_trim" multiple times. Please try removing one of the defines to avoid getting this error. I'm guessing you have defined it in both the header and .c file. Please check it out and try again.

    Best regards,

    Simon

  • Thank you for your help.

    I double checked my project. But "osc_trim" variable is only in OB1203.h file

    Follow the SEGGER error both file SEGGER said multiple definition is OB1203.h file, means one file. That one is not make sense to me. Do you have any else ideal.

    Output/blinky_pca10040_s132 Release/Obj/OB1203.o:C:\Users.......OB1203.h:195: multiple definition of `osc_trim'; Output/blinky_pca10040_s132 Release/Obj/main.o:C:\Users............OB1203.h:195: first defined here

Reply
  • Thank you for your help.

    I double checked my project. But "osc_trim" variable is only in OB1203.h file

    Follow the SEGGER error both file SEGGER said multiple definition is OB1203.h file, means one file. That one is not make sense to me. Do you have any else ideal.

    Output/blinky_pca10040_s132 Release/Obj/OB1203.o:C:\Users.......OB1203.h:195: multiple definition of `osc_trim'; Output/blinky_pca10040_s132 Release/Obj/main.o:C:\Users............OB1203.h:195: first defined here

Children
Related