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
  • I think it makes sense that the error occur at linking because the compiler can only assume that the function definitions will exist once all sources are compiled. However, I can't think of anything to explain why it stops working just because you moved the project location. Sorry, but can you please double check again that the correct header is included with the app_uart_fifo.c file as shown in the screenshot below.

Children
Related