From the instructions here:
https://docs.espressif.com/projects/esp ... components
...I believe that, provided that the library (named geodesic) is created with:
Code: Select all
add_library(geodesic STATIC ${GEODESIC_SRC})
target_include_directories(geodesic PRIVATE ${GEODESIC_INC})
Code: Select all
COMPONENT_REQUIRES(... geodesic)
Code: Select all
COMPONENT_REQUIRES is driver;esp_timer;mbedtls;esp_system;geodesic
Code: Select all
[653/658] Linking CXX executable final.elf
FAILED: final.elf
cmd.exe /C "cd . && C:\Users\rmea\.ubxlibpkg\esp_idf_tools-v5.0.3\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -Wno-frame-address @CMakeFiles\final.elf.rsp -o final.elf && cd ."
c:/users/rmea/.ubxlibpkg/esp_idf_tools-v5.0.3/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/11.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/final/libmain.a(geodesic_user.cpp.obj):(.literal.uGnssFenceWgs84GeodDirect+0x0): undefined reference to `GeographicLib::Geodesic::WGS84()'
c:/users/rmea/.ubxlibpkg/esp_idf_tools-v5.0.3/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/11.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/final/libmain.a(geodesic_user.cpp.obj):(.literal.uGnssFenceWgs84GeodDirect+0x4): undefined reference to `GeographicLib::Geodesic::GenDirect(double, double, double, bool, double, unsigned int, double&, double&, double&, double&, double&, double&, double&, double&) const'
...
I've tried making the target_include_directories() of type PUBLIC, in case that is upsetting C++ somehow (all of the other files built into the application are only .c code), but that doesn't help. I don't believe there is anything wrong with the code or header files themselves since, with exactly the same code and CMake files, GCC under Linux and MSVC under Windows build (and run) to completion.
I've also tried adding a plain-old .c file to the geodesic library and calling a function in that from my main code: that function also seems to be unavailable, so this is not just a C++ thing, the entire libgeodesic.a is not being given to the link stage for some reason.