I'm having an issue while linking my executable I'm the esp-idf. I'm getting a lot of "undefined reference to" functions in the output failing the build. This made me believe that there is an issue with missing source files included in the build but this is not the case, I have the associated object files needed for linking in my build directory. The following is a brief overview of my build setup:
Code: Select all
- drivers
- needed src/libs
- CMakeLists.txt
- interface
- needed src/libs
- CMakeLists.txt
- main
- needed src/libs
- CMakeLists.txt
- lib
- needed src/libs
- CMakeLists.txt
- platform
- needed src/libs
- CMakeLists.txt
- CMakeLists.txt
For example the LM75 driver depends on the I2C interface and the temperature interface depends on the LM75 driver. Now some components from drivers are required in interface and visa versa.
I'm thinking that because under registered components:
PRIV_REQUIRES: interface(for drivers)
PRIV_REQUIRES: drivers(for interface)
There is a dual dependency happening and the linker is not able to determine the order of operation needed to link these files.
I've come across this error before in CMake environments but have always found work around, with the ESP-IDF there is a lot of abstraction within the CMake files and does not allow a lot of manipulation.
I'm just curious if anyone else has had this issue and what they did to fix this