Hi everyone,
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?
Error result:
/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 - Archive
Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!
Your resources:
The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.
For dedicated assistance, explore our Embedded Wizard Product Support.
You can still browse the valuable discussions from our community history here.
Embedded Wizard Website | Privacy Policy | Imprint