BME680 platform IO ESP32

 Hello
 
I'm trying to configure the BSEC library on platform io in order to use a BME680 that I have connected to an ESP32, but no matter what I do I always get 
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec11beginCommonEv+0x4): undefined reference to
`bsec_init'
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec11beginCommonEv+0x8): undefined reference to
`bsec_get_version'
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec18updateSubscriptionEP21bsec_virtual_sensor_thf+0x0): undefined reference to `bsec_update_subscription'
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec8setStateEPh+0x0): undefined reference to `bsec_set_state'
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec15readProcessDataEx19bsec_bme_settings_t+0x14): undefined reference to `bsec_do_steps'
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec3runEx+0x0): undefined reference to `bsec_sensor_control'
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o):(.literal._ZN4Bsec3runEx+0x4): undefined reference to `bsec_get_state'
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o): In function `Bsec::beginCommon()':
D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:477: undefined reference to `bsec_init'
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o): In function `Bsec::getVersion()':
D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:477: undefined reference to `bsec_get_version'
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o): In function `Bsec::updateSubscription(bsec_virtual_sensor_t*,
unsigned char, float)':
D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:477: undefined reference to `bsec_update_subscription'
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o): In function `Bsec::setState(unsigned char*)':
D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:477: undefined reference to `bsec_set_state'
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o): In function `Bsec::readProcessData(long long, bsec_bme_settings_t)':
D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:386: undefined reference to `bsec_do_steps'
.pio\build\esp32\lib149\libBSEC Software Library_ID6979.a(bsec.cpp.o): In function `Bsec::run(long long)':
D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:201: undefined reference to `bsec_init'
D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:211: undefined reference to `bsec_update_subscription'
D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:211: undefined reference to `bsec_sensor_control'
D:\Ascough\XPS\SE\Projects\SymphonySense\Code\PlatformIO\SSv0.1 - ESP32/.pio\libdeps\esp32\BSEC Software Library_ID6979\src/bsec.cpp:247: undefined reference to `bsec_get_state'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32\firmware.elf] Error 1
 
I saw the instructions for the library but I cannot find the platform txt nor I know what to put on it.
Could you please advice what's the correct way to do it?
Thanks 
Best reply by peter3099

Finally I got it to  compile, thanks so much for that

 

In case anybody need it the final platform.ini file needs to have

If you want to have the libraries install within the project folder

build_flags =
  -I .pio/libdeps/esp32/BSEC\ Software\ Library_ID6979/src/inc
  -L .pio/libdeps/esp32/BSEC\ Software\ Library_ID6979/src/esp32
  -lalgobsec
lib_deps = 
    BSEC Software Library
 
One can also install the library locally and point the path to the different folders
Stay safe!
View original
12 replies
Resolved