I have a library that I want to include in the DeviceDriver.c. In the file I have inserted #include "mcp3424.h".
but the functions are not found?what am I doing wrong?
/usr/bin/ld: ./obj/DeviceDriver.o: in function `DeviceDriver_GetO2':DeviceDriver.c:(.text+0x9b8): undefined reference to `mcp3424_init'/usr/bin/ld: DeviceDriver.c:(.text+0x9c4): undefined reference to `mcp3424_set_conversion_mode'/usr/bin/ld: DeviceDriver.c:(.text+0x9e0): undefined reference to `mcp3424_get_raw'collect2: error: ld returned 1 exit statusmake: *** [Makefile:150: EmbeddedWizard-RasPi-CM4] Error 1
Hello,including your header file into the DeviceDriver.c file makes it possible for the compiler to find the declarations of your library functions.The reported error message is a linker error. Please add your library to the set of libraries in the makefile (e.g. using -l in the makefile) or as additional library in your project configuration.Then the linker will find the requested functions.Best regards,Manfred.
Ask Embedded Wizard
Welcome to the question and answer site for Embedded Wizard users and UI developers.
Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!