AnsweredAssumed Answered

Header and C files included... but keep getting "undefinied reference to"

Question asked by es483 on Dec 12, 2017
Latest reply on Dec 15, 2017 by es483

Dear NXP users,

 

I'm having from a few days a problem that I wasn't able to solve, and to which I can't find any solution.

I downloaded, after registering, the following example code from the Micrium uC-OS website: FRDM-K64F_OS3-TCPIP-HTTPs-DHCPc-KSDK-LIB | Micrium 

The problem is that the project is already present only for IAR and Keil, but I need to work with KDS only.

I tested the project on a 30-days trial version of IAR, and it works perfectly.

Then, I tried adding the files I needed to an existing project in KDS, copying them in the correct folders and linking them to the KDS project.

The problem is the following: everything compiles... until I call some function that references to the library! In that case I keep getting "undefined reference to..." to functions that are defined in .h/.c files that are included!

After calling, for instante, AppTCPIP_Init(), that is a function provided by the library uC-TCP/IP, I cannot compile anymore.
For example, inside "app_dhcp-c.c" there's a function call:

            dhcp_status = DHCPc_ChkStatus(if_nbr, &err_dhcp);

The compiler tells me:

         "Undefined reference to 'DHCPc_ChkStatus'"

While DHCPc_ChkStatus() is definied in "dhcp-c.h", that is included though a chain of header files. Also including it directly by adding:

#include "dhcp-c.h"

does not change the situation at all.

Please help, I really need to be able to launch soon this project in KDS.

What am I missing?

Thanks a lot in advance!

Outcomes