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

Linker unable to find function definition despite .c file being in the project and .h file included

Hi,

I encountered an issue when moving my project directory within my computer.
In fact, the linker seems to be unable to find some functions definitions :

Error[Li005]: no definition for "app_uart_init" [referenced from .....\main.o]
Error[Li005]: no definition for "app_uart_put" [referenced from .....\main.o]

These functions are defined in app_uart_fifo.c and the source file is included in my project workspace.


My investigations have shown that the first if condition of the source file is not working as expected:


#if NRF_MODULE_ENABLED(APP_UART)
...
app_uart_init definition
app_uart_put definition

...

#endif

Thus I checked if APP_UART_ENABLED was defined, and its defintion can be found in sdk_config.h which also is included within my project workspace.
Bypassing this if condition only creates more errors as some identifiers are undefined.

I don't know anymore what to try in order to fix my issue, any idea ?
(FYI I am working on IAR 8.50.6.28951)

Thanks in advance for your help !

Parents Reply
  • Bypassing the APP_UART_ENABLE generates 5 new errors :

    Error[Pe020]: identifier "APP_UART_DRIVER_INSTANCE" is undefined D:\....\app_uart_fifo.c 47
    Error[Pe020]: identifier "NRF_UARTE_HWFC_DISABLED" is undefined D:\....\app_uart_fifo.c 162
    Error[Pe020]: identifier "NRF_UARTE_HWFC_ENABLED" is undefined D:\....\app_uart_fifo.c 162
    Error[Pe020]: identifier "NRF_UARTE_PARITY_INCLUDED" is undefined D:\....\app_uart_fifo.c 164
    Error[Pe020]: identifier "NRF_UARTE_PARITY_EXCLUDED" is undefined D:\....\app_uart_fifo.c 164

    app_uart_fifo.c is included in my workspace and, for example, I found the #define APP_UART_DRIVER_INSTANCE within the sdk_config.
    The preprocessor options for the compiler contains the path for the nrf52840 sdk_config file and I don't see another path that could lead to another sdk_config.

    What puzzles me is that the linker does not find the function definitions whereas the compiler seems ok. Could it come from a wrong compilation where the compiler does not warn us about a problem ?

Children
Related