I am working on a project where I need to work with PicoTCP (see https://developer.mbed.org/users/daniele/code/PicoTCP/ , I use an older version of this library). In my main.cpp file, I have the following code:
#include "pico_stack.h" #include "pico_dhcp_server.h" int main(void) {
The pico_dhcp_server_initiate function pico_dhcp_server_initiate declared in pico_dhcp_server.h :
#ifndef _INCLUDE_PICO_DHCP_SERVER #define _INCLUDE_PICO_DHCP_SERVER #include "pico_dhcp_common.h" #include "pico_addressing.h" ... omitted some declarations ... int pico_dhcp_server_initiate(struct pico_dhcpd_settings *setting); #endif
And this method is implemented in pico_dhcp_server.c :
int pico_dhcp_server_initiate(struct pico_dhcpd_settings *setting) { ... }
When compiling the code, I get the following error: Undefined reference to pico_dhcp_server_initiate(pico_dhcpd_settings *) . I am compiling with a Makefile that looks like this:
-DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -D__CORTEX_M3 -DARM_MATH_CM3 -DMBED_BUILD_TIMESTAMP = 1432213479.57 -D__MBED __ =
I am not sure what causes this error. I believe the .c file does not compile in some way, but I am very new to Makefile syntax. Maybe something is wrong in the makefile? Can someone help me with this?
source share