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

implicit declaration of function undefined reference in C

Hi, I'm new to C language. I copied and pasted nordic example TWI codes to my self-defined SDP31.c file. And declared some of the functions in SDP31.h.

After clean and rebuild the solution in SEGGER, I got an error (see below). However, if I double click this error message, it jumps to a place where no code at all (see image). Note: I have #include "ADC.h" and "SDP31.h" in main.c

Output/Release/Obj/ble_app_uart_pca10040e_nrf52805_s112/main.o: in function `main':
undefined reference to `ADC_Battery'
D:\Aimwell\SDK_Code\example\Aimwell\20210629 BLE + sIIR SDP31 + 2 sADC + sBattery v5/main.c:961: undefined reference to `ADC_Pressure'
There are some more messages provided by segger in Source Navigator: 

conflicting types for 'twi_handler'
incompatible function pointer types passing 'void (const nrf_drv_twi_evt_t, void *)' to parameter of type 'nrf_drv_twi_evt_handler_t' (aka 'void (*)(const nrf_drv_twi_evt_t *, void *)')

Here is my twi_handler. Note that it's not declared in SDP31.h since it will only be called inside the SDP31.c file. 

Any idea, please? Thanks! 

Related