Hey,
I have tried to solve this problem and had no success.
I am using an Arduino Mega and a BME680 sensor for measuring the temperature, humidity, AQI and so on..
Communicating through I2c
Happy for any Help
Build options changed, rebuilding all
xxxxxxxxxxxx\AppData\Local\Temp\ccovOwvy.ltrans0.ltrans.o: In function `main':
:(.text.startup+0x212): undefined reference to `bsec_init'
:(.text.startup+0x222): undefined reference to `bsec_get_version'
:(.text.startup+0x556): undefined reference to `bsec_update_subscription'
:(.text.startup+0x81a): undefined reference to `bsec_sensor_control'
:(.text.startup+0x1986): undefined reference to `bsec_do_steps'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
Usually these sorts of errors mean that you installed only the header file of the library (bsec.h) and didn't also install the other source files of the library.
Please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded the bsec library from. Or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.
OK, I was wrong about the cause of the error. It turns out this library is pretty complicated to use, as documented here:
To make matters worse, they provide specific instructions for SAMD and ESP8266, but not for the AVR architecture of your Arduino Mega. Here's what you need to do:
File > Examples > SPI > BarometricPressureSensor (or any other SPI example sketch)
Sketch > Show Sketch Folder
Move up folder levels until you reach the one that contains platform.txt
I should mention that you will need to redo this every time you update to a new version of Arduino AVR Boards or the error when using the bsec library will come back.
You're welcome. I'm glad to hear it's working now. I agree that having to make the modification on every update is annoying. Someone did submit a pull request a while back to make this change in Arduino AVR Boards (and I believe the other official Arduino cores too) so hopefully that will get merged eventually:
Until then, you can make the update a little easier by defining the customized recipe.c.combine.pattern in a file named platform.local.txt that is located in the same folder as platform.txt. The recipes defined in platform.local.txt override the ones in platform.txt. The idea behind this feature is to make it easy for people to customize platform.txt without actually needing to edit the file. Save a copy of your platform.local.txt somewhere safe. That way, after every update of Arduino AVR Boards, you only need to copy platform.local.txt into the folder.