Minimal example repository: GitHub - atfox98/golioth-pio
I’m trying to include an ESP-IDF component in my project, golioth-firmware-sdk. I am pretty sure the component is configured and added correctly: it’s options show up in the menuconfig, I can see that it is building correctly, the archive is in the build directory, and using nm
shows that all of the functions are in there. When using verbose build, it looks like the directory is included correctly in the link step and all is well. At this point, however, there is a linker error. Undefined references to every function I call from the component. Looking at the map file that is generated, the component functions aren’t there.
I’ve tried the following things to resolve this issue:
- Change LINK_INTERFACE_MULTIPLICITY in CMakeLists.txt for the golioth component. The build system page in the espressif documentation under “Circular Dependencies” mentions this can fix some undefined reference problems. Even making the value ridiciously high (100+) doesn’t work.
- Add the linker flags manually in PlatformIO build flags (-Lpath/to/golioth_sdk and -lgolioth_sdk.a)
- Use a pre: script to pass the same link flags as above, per this documentation
At this point I have no idea what to do and any insight would be greatly appreciated. I think this has something to do with the PlatformIO build system, I just do not know what that thing is.
It also looks like this poster was having the same issue (undefined references with a component) but there were never any responses.