11-10-2022 09:35 AM - edited 11-10-2022 09:36 AM
Hello,
I'm trying to setup Arduino development environment for ESP32 platform on Linux.
I've installed following packages:
- Arduino 1.8.19
- ESP32 platform: 2.0.5
- latest BSEC2 lib from https://github.com/BoschSensortec/Bosch-BSEC2-Library as ZIP archive
- latest MBE68x lib from https://github.com/BoschSensortec/Bosch-BME68x-Library as ZIP archive
Trying to compile the a basic BSEC2 exapmle sketch leads to a very known linker error: e.g.:
/home/vitali/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: libraries/Bosch-BSEC2-Library-master/bsec2.cpp.o:(.literal._ZN5Bsec218updateSubscriptionEP21bsec_virtual_sensor_thf+0x0): undefined reference to `bsec_update_subscription'
/home/vitali/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: libraries/Bosch-BSEC2-Library-master/bsec2.cpp.o:(.literal._ZN5Bsec28getStateEPh+0x8): undefined reference to `bsec_get_state'
/home/vitali/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: libraries/Bosch-BSEC2-Library-master/bsec2.cpp.o:(.literal._ZN5Bsec28setStateEPh+0x0): undefined reference to `bsec_set_state'
Obviously, the platform.txt file for ESP32 2.0.5 needs to be updated. (The original platform.txt file from ESP32 2.0.5 is in att)
Please note: all available in the forum fixes for platform.txt file have too many differences to the 2.0.5 and doesn't wok ether.
Thanks in advance!
11-10-2022 10:28 AM
... putting the linker flags in to platform.local.txt (in the same dir as platform.txt)
pointing to the BSEC2 lib solves the problem, e.g.:
compiler.libraries.ldflags=-L/home/vitali/Arduino/libraries/Bosch-BSEC2-Library-master/src/esp32 -lalgobsec
But, the question is, is it the proper way how the third party libs should be integrated?
11-14-2022 08:19 AM
Hi fritz,
You could refer the integration guide https://github.com/BoschSensortec/BSEC-Arduino-library/blob/master/README.md for Arduino enrivonment.