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

Multiple definition error in app_uart_fifo

Hi

I combined ble_app_uart with relay example .I am getting a multiple definition error in app_uart_fifo while building.I have added required .c files and their header paths and also compared the sdk config file of uart example with relay example.Please let me know if I am missing something.Find below the attached screenshot.

Thank you

  • Ignore the previous screenshot.Please refer to this screenshot

    .

  • The message text says it all:

    A "multiple definition" means that you have the same thing defined in multiple places.

    The 'C' programming language requires that things must be defined once - and only once.

    The message also tells you where it is finding all the multiple  definitions - so you need to go through those definitions, and decide which is the one to keep.

    This is standard 'C' stuff - nothing specifically to do with Nordic or SES

    It would be easier to analyse & explain the messages if you copied them & pasted text

    Post as for source code, but omit step 3 (ie, leave as just 'Text):

  • So this error has nothing to do with some missing file or configuration setting ?Because the app_uart_fifo.c file is added directly from the library with no changes or editing done,so chances are this error could be because of changed configuration or clashing definitions.

  • Building ‘ble_app_hrs_rscs_relay_pca10040_s132’ from solution ‘ble_app_hrs_rscs_relay_pca10040_s132’ in configuration ‘Release’
      
      
      Linking ble_app_hrs_rscs_relay_pca10040_s132.elf
      
      
        Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/app_uart_fifo.o: in function `app_uart_init':
        multiple definition of `app_uart_init'; Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/app_uart.o:C:\Users\admin\Desktop\nRF5_SDK_15.3.0_59ac345\components\libraries\uart/app_uart.c:85: first defined here
      
        Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/app_uart_fifo.o: in function `app_uart_flush':
        multiple definition of `app_uart_flush'; Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/app_uart.o:C:\Users\admin\Desktop\nRF5_SDK_15.3.0_59ac345\components\libraries\uart/app_uart.c:153: first defined here
      
        Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/app_uart_fifo.o: in function `app_uart_get':
        multiple definition of `app_uart_get'; Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/app_uart.o:C:\Users\admin\Desktop\nRF5_SDK_15.3.0_59ac345\components\libraries\uart/app_uart.c:120: first defined here
      
        Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/app_uart_fifo.o: in function `app_uart_put':
        multiple definition of `app_uart_put'; Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/app_uart.o:C:\Users\admin\Desktop\nRF5_SDK_15.3.0_59ac345\components\libraries\uart/app_uart.c:133: first defined here
      
        Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/app_uart_fifo.o: in function `app_uart_close':
        multiple definition of `app_uart_close'; Output/ble_app_hrs_rscs_relay_pca10040_s132 Release/Obj/app_uart.o:C:\Users\admin\Desktop\nRF5_SDK_15.3.0_59ac345\components\libraries\uart/app_uart.c:156: first defined here
    Build failed

  • Hi Kriti

    It seems like you have 2 app_uart_fifo.c files in your project. Both 1682.app_uart_fifo_mod.c and app_uart_fifo.c defines the same functions, so you should remove one of them from your project. 

    Best regards,

    Simon

Related