BME680 + MEGA 2560 undefined reference to ' ' - Sensor Library bsec.h

Hey,
I have tried to solve this problem and had no success.
I am using an Arduino Mega 2560 and a BME680 sensor for measuring the temperature, humidity, AQI and so on..
Communicating through ISP
Happy for any Help

Arduino ide 1.8.11 BSEC 1.5.1474

my platform.txt

# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.S.extra_flags=
compiler.cpp.extra_flags=
compiler.ar.extra_flags=
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=
compiler.libraries.ldflags=
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" {compiler.libraries.ldflags} "-L{build.path}" -lm

error

C:\Users\Evgeny\AppData\Local\Temp\ccADlbvY.ltrans0.ltrans.o: In function `main':

<artificial>:(.text.startup+0x4ea): undefined reference to `bsec_init'

<artificial>:(.text.startup+0x4fa): undefined reference to `bsec_get_version'

<artificial>:(.text.startup+0x650): undefined reference to `bsec_update_subscription'

<artificial>:(.text.startup+0x824): undefined reference to `bsec_init'

<artificial>:(.text.startup+0x84c): undefined reference to `bsec_set_state'

<artificial>:(.text.startup+0x88c): undefined reference to `bsec_update_subscription'

<artificial>:(.text.startup+0x922): undefined reference to `bsec_sensor_control'

<artificial>:(.text.startup+0x1f3e): undefined reference to `bsec_do_steps'

<artificial>:(.text.startup+0x25d6): undefined reference to `bsec_get_state'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino Mega or Mega 2560.

on platform.txt NOT EDITED, SAME ERROR

Please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded the 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.


Please post your full sketch.

If possible, you should always post code directly in the forum thread as text using code tags:

  • Do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code. This will make it easier for you to spot bugs and make it easier for us to read.
  • In the Arduino IDE or Arduino Web Editor, click on the window that contains your sketch code.
  • Press "Ctrl + A". This will select all the text.
  • Press "Ctrl + C". This will copy the selected text to the clipboard.
  • In a forum reply here, click the "Reply" button.
  • click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the sketch between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
  • Repeat the above process if your sketch has multiple tabs.

This will make it easy for anyone to look at it, which will increase the likelihood of you getting help.

If the sketch is longer than the 9000 characters maximum allowed by the forum, then it's OK to add it as an attachment. After clicking the "Reply" button, you will see an "Attachments and other settings" link.

Library installed using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE) BSEC Software Library 1.5.1474

full sketch is ..\BSEC_Software_Library\examples\basic\basic.ino

#include "bsec.h"

// Helper functions declarations
void checkIaqSensorStatus(void);
void errLeds(void);

// Create an object of the class Bsec
Bsec iaqSensor;

String output;

// Entry point for the example
void setup(void)
{
  Serial.begin(115200);
  Wire.begin();

  iaqSensor.begin(BME680_I2C_ADDR_PRIMARY, Wire);
  output = "\nBSEC library version " + String(iaqSensor.version.major) + "." + String(iaqSensor.version.minor) + "." + String(iaqSensor.version.major_bugfix) + "." + String(iaqSensor.version.minor_bugfix);
  Serial.println(output);
  checkIaqSensorStatus();

  bsec_virtual_sensor_t sensorList[10] = {
    BSEC_OUTPUT_RAW_TEMPERATURE,
    BSEC_OUTPUT_RAW_PRESSURE,
    BSEC_OUTPUT_RAW_HUMIDITY,
    BSEC_OUTPUT_RAW_GAS,
    BSEC_OUTPUT_IAQ,
    BSEC_OUTPUT_STATIC_IAQ,
    BSEC_OUTPUT_CO2_EQUIVALENT,
    BSEC_OUTPUT_BREATH_VOC_EQUIVALENT,
    BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE,
    BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY,
  };

  iaqSensor.updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_LP);
  checkIaqSensorStatus();

  // Print the header
  output = "Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity [%], gas [Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], Static IAQ, CO2 equivalent, breath VOC equivalent";
  Serial.println(output);
}

// Function that is looped forever
void loop(void)
{
  unsigned long time_trigger = millis();
  if (iaqSensor.run()) { // If new data is available
    output = String(time_trigger);
    output += ", " + String(iaqSensor.rawTemperature);
    output += ", " + String(iaqSensor.pressure);
    output += ", " + String(iaqSensor.rawHumidity);
    output += ", " + String(iaqSensor.gasResistance);
    output += ", " + String(iaqSensor.iaq);
    output += ", " + String(iaqSensor.iaqAccuracy);
    output += ", " + String(iaqSensor.temperature);
    output += ", " + String(iaqSensor.humidity);
    output += ", " + String(iaqSensor.staticIaq);
    output += ", " + String(iaqSensor.co2Equivalent);
    output += ", " + String(iaqSensor.breathVocEquivalent);
    Serial.println(output);
  } else {
    checkIaqSensorStatus();
  }
}

// Helper function definitions
void checkIaqSensorStatus(void)
{
  if (iaqSensor.status != BSEC_OK) {
    if (iaqSensor.status < BSEC_OK) {
      output = "BSEC error code : " + String(iaqSensor.status);
      Serial.println(output);
      for (;;)
        errLeds(); /* Halt in case of failure */
    } else {
      output = "BSEC warning code : " + String(iaqSensor.status);
      Serial.println(output);
    }
  }

  if (iaqSensor.bme680Status != BME680_OK) {
    if (iaqSensor.bme680Status < BME680_OK) {
      output = "BME680 error code : " + String(iaqSensor.bme680Status);
      Serial.println(output);
      for (;;)
        errLeds(); /* Halt in case of failure */
    } else {
      output = "BME680 warning code : " + String(iaqSensor.bme680Status);
      Serial.println(output);
    }
  }
}

void errLeds(void)
{
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(100);
  digitalWrite(LED_BUILTIN, LOW);
  delay(100);
}

for SPI

/*
 Name:    TestBME680_BSEC.ino
 Created: 2/23/2020 11:32:55 AM
 Author:  Evgeny
*/

#include "bsec.h"

// Helper functions declarations
void checkIaqSensorStatus(void);
void errLeds(void);

// Create an object of the class Bsec
Bsec iaqSensor;
#define BME680_SPI_CS 10

String output;

// Entry point for the example
void setup(void)
{
  Serial.begin(115200);
  //Wire.begin();
  SPI.begin();

  //iaqSensor.begin(BME680_I2C_ADDR_PRIMARY, Wire);
  iaqSensor.begin(BME680_SPI_CS, SPI);

  output = "\nBSEC library version " + String(iaqSensor.version.major) + "." + String(iaqSensor.version.minor) + "." + String(iaqSensor.version.major_bugfix) + "." + String(iaqSensor.version.minor_bugfix);
  Serial.println(output);
  checkIaqSensorStatus();

  bsec_virtual_sensor_t sensorList[10] = {
    BSEC_OUTPUT_RAW_TEMPERATURE,
    BSEC_OUTPUT_RAW_PRESSURE,
    BSEC_OUTPUT_RAW_HUMIDITY,
    BSEC_OUTPUT_RAW_GAS,
    BSEC_OUTPUT_IAQ,
    BSEC_OUTPUT_STATIC_IAQ,
    BSEC_OUTPUT_CO2_EQUIVALENT,
    BSEC_OUTPUT_BREATH_VOC_EQUIVALENT,
    BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE,
    BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY,
  };

  iaqSensor.updateSubscription(sensorList, 10, BSEC_SAMPLE_RATE_LP);
  checkIaqSensorStatus();

  // Print the header
  output = "Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity [%], gas [Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], Static IAQ, CO2 equivalent, breath VOC equivalent";
  Serial.println(output);
}

// Function that is looped forever
void loop(void)
{
  unsigned long time_trigger = millis();
  if (iaqSensor.run()) { // If new data is available
    output = String(time_trigger);
    output += ", " + String(iaqSensor.rawTemperature);
    output += ", " + String(iaqSensor.pressure);
    output += ", " + String(iaqSensor.rawHumidity);
    output += ", " + String(iaqSensor.gasResistance);
    output += ", " + String(iaqSensor.iaq);
    output += ", " + String(iaqSensor.iaqAccuracy);
    output += ", " + String(iaqSensor.temperature);
    output += ", " + String(iaqSensor.humidity);
    output += ", " + String(iaqSensor.staticIaq);
    output += ", " + String(iaqSensor.co2Equivalent);
    output += ", " + String(iaqSensor.breathVocEquivalent);
    Serial.println(output);
  } else {
    checkIaqSensorStatus();
  }
}

// Helper function definitions
void checkIaqSensorStatus(void)
{
  if (iaqSensor.status != BSEC_OK) {
    if (iaqSensor.status < BSEC_OK) {
      output = "BSEC error code : " + String(iaqSensor.status);
      Serial.println(output);
      for (;;)
        errLeds(); /* Halt in case of failure */
    } else {
      output = "BSEC warning code : " + String(iaqSensor.status);
      Serial.println(output);
    }
  }

  if (iaqSensor.bme680Status != BME680_OK) {
    if (iaqSensor.bme680Status < BME680_OK) {
      output = "BME680 error code : " + String(iaqSensor.bme680Status);
      Serial.println(output);
      for (;;)
        errLeds(); /* Halt in case of failure */
    } else {
      output = "BME680 warning code : " + String(iaqSensor.bme680Status);
      Serial.println(output);
    }
  }
}

void errLeds(void)
{
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(100);
  digitalWrite(LED_BUILTIN, LOW);
  delay(100);
}

in the Arduino Web Editor (Libraries > Library Manager) same error

now with Arduino IDE 1.8.12

C:\Users\Evgeny\AppData\Local\Temp\ccA4Gtnz.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_basic.ino.cpp.o.2317':

<artificial>:(.text.startup+0x5c): undefined reference to `Bsec::Bsec()'

C:\Users\Evgeny\AppData\Local\Temp\ccA4Gtnz.ltrans0.ltrans.o: In function `main':

<artificial>:(.text.startup+0x220): undefined reference to `Bsec::delay_ms(unsigned long)'

<artificial>:(.text.startup+0x222): undefined reference to `Bsec::delay_ms(unsigned long)'

<artificial>:(.text.startup+0x22e): undefined reference to `Bsec::begin(unsigned char, SPIClass&, void (*)(unsigned long))'

<artificial>:(.text.startup+0x2d8): undefined reference to `Bsec::updateSubscription(bsec_virtual_sensor_t*, unsigned char, float)'

<artificial>:(.text.startup+0x314): undefined reference to `Bsec::run(long long)'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino Mega or Mega 2560.
C:\Users\Evgeny\AppData\Local\Temp\cco2PIF6.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_basic.ino.cpp.o.2322':

<artificial>:(.text.startup+0x74): undefined reference to `Bsec::Bsec()'

C:\Users\Evgeny\AppData\Local\Temp\cco2PIF6.ltrans0.ltrans.o: In function `main':

<artificial>:(.text.startup+0x242): undefined reference to `Bsec::delay_ms(unsigned long)'

<artificial>:(.text.startup+0x244): undefined reference to `Bsec::delay_ms(unsigned long)'

<artificial>:(.text.startup+0x250): undefined reference to `Bsec::begin(unsigned char, TwoWire&, void (*)(unsigned long))'

<artificial>:(.text.startup+0x2fa): undefined reference to `Bsec::updateSubscription(bsec_virtual_sensor_t*, unsigned char, float)'

<artificial>:(.text.startup+0x336): undefined reference to `Bsec::run(long long)'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino Mega or Mega 2560.

I changed the order in which object files are fed to the linker.

The precompiled libraries used to after the Arduino code libraries.
This produces linker errors when the precompiled library uses Arduino code libraries.

The order is now:

  • Sketch ino
  • Objects of library source files
  • precompiled library objects
  • Arduino core
## Combine gc-sections, archives, and objects
- recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.c.elf.extra_flags} "{build.path}/{archive_file}" "-L{build.path}" -lm

+ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.libraries.ldflags} "{build.path}/{archive_file}" "-L{build.path}" -lm

so

recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" {compiler.libraries.ldflags} "-L{build.path}" -lm

changet to

recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.libraries.ldflags} "{build.path}/{archive_file}" "-L{build.path}" -lm

but SAME ERROR

With Arduino IDE 1.8.12

These can be overridden in platform.local.txt

compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.S.extra_flags=
compiler.cpp.extra_flags=
compiler.ar.extra_flags=
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=
compiler.libraries.ldflags=

Combine gc-sections, archives, and objects

recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.libraries.ldflags} "{build.path}/{archive_file}" "-L{build.path}" -lm

Arduino: 1.8.12 (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Evgeny\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Evgeny\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Evgeny\Documents\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -ide-version=10812 -build-path c:\Temp\arduino_build_187617 -warnings=none -build-cache c:\Temp\arduino_cache_163588 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -**prefs=runtime.tools.arduinoOTA.path=**C:\Program Files (x86)\Arduino\hardware\tools\avr -**prefs=runtime.tools.arduinoOTA-1.3.0.path=**C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose D:\Users\Evgeny\Documents\Arduino\sketch_mar21a\sketch_mar21a.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Evgeny\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Evgeny\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Evgeny\Documents\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -ide-version=10812 -build-path c:\Temp\arduino_build_187617 -warnings=none -build-cache c:\Temp\arduino_cache_163588 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -**prefs=runtime.tools.arduinoOTA-1.3.0.path=**C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose D:\Users\Evgeny\Documents\Arduino\sketch_mar21a\sketch_mar21a.ino
Using board 'mega' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "c:\Temp\arduino_build_187617\sketch\sketch_mar21a.ino.cpp" -o nul
Alternatives for bsec.h: [BSEC_Software_Library@1.5.1474]
ResolveLibrary(bsec.h)
-> candidates: [BSEC_Software_Library@1.5.1474]
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "-IC:\Users\Evgeny\Documents\Arduino\libraries\BSEC_Software_Library\src" "c:\Temp\arduino_build_187617\sketch\sketch_mar21a.ino.cpp" -o nul
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
-> candidates: [Wire@1.0]
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "-IC:\Users\Evgeny\Documents\Arduino\libraries\BSEC_Software_Library\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "c:\Temp\arduino_build_187617\sketch\sketch_mar21a.ino.cpp" -o nul
Alternatives for SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
-> candidates: [SPI@1.0]

i think error in bolded part

-prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr

nead be

-prefs=runtime.tools.arduino OTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr

han6man:
i think error in bolded part
nead to be

The tool name arduinoOTA is correct. That is completely unrelated to the error you are getting. arduinoOTA is only used for uploading over the network. If there was a problem with arduinoOTA, it would cause an upload failure, not a compilation failure.

I'm pretty sure the bug you have encountered is this one:

For now, the workaround you found of rolling back to Arduino IDE 1.8.11 is the best thing to do. The bug should be fixed in the next release of the Arduino IDE.

"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "-IC:\Users\Evgeny\Documents\Arduino\libraries\BSEC_Software_Library\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "c:\Temp\arduino_build_187617\sketch\sketch_mar21a.ino.cpp" -o nul
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "-IC:\Users\Evgeny\Documents\Arduino\libraries\BSEC_Software_Library\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "C:\Users\Evgeny\Documents\Arduino\libraries\BSEC_Software_Library\src\bme680\bme680.c" -o nul
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "-IC:\Users\Evgeny\Documents\Arduino\libraries\BSEC_Software_Library\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "C:\Users\Evgeny\Documents\Arduino\libraries\BSEC_Software_Library\src\bsec.cpp" -o nul
Using cached library dependencies for file: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src\Wire.cpp
Using cached library dependencies for file: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src\utility\twi.c
Using cached library dependencies for file: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src\SPI.cpp
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "-IC:\Users\Evgeny\Documents\Arduino\libraries\BSEC_Software_Library\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "c:\Temp\arduino_build_187617\sketch\sketch_mar21a.ino.cpp" -o "c:\Temp\arduino_build_187617\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "c:\Temp\arduino_build_187617\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "-IC:\Users\Evgeny\Documents\Arduino\libraries\BSEC_Software_Library\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "c:\Temp\arduino_build_187617\sketch\sketch_mar21a.ino.cpp" -o "c:\Temp\arduino_build_187617\sketch\sketch_mar21a.ino.cpp.o"
Compiling libraries...
Compiling library "BSEC_Software_Library"
Compiling library "Wire"
Using previously compiled file: c:\Temp\arduino_build_187617\libraries\Wire\Wire.cpp.o
Using previously compiled file: c:\Temp\arduino_build_187617\libraries\Wire\utility\twi.c.o
Compiling library "SPI"
Using previously compiled file: c:\Temp\arduino_build_187617\libraries\SPI\SPI.cpp.o
Compiling core...
Using precompiled core: c:\Temp\arduino_cache_163588\core\core_arduino_avr_mega_cpu_atmega2560_0c812875ac70eb4a9b385d8fb077f54c.a
Linking everything together...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o "c:\Temp\arduino_build_187617/sketch_mar21a.ino.elf" "c:\Temp\arduino_build_187617\sketch\sketch_mar21a.ino.cpp.o" "c:\Temp\arduino_build_187617\libraries\Wire\Wire.cpp.o" "c:\Temp\arduino_build_187617\libraries\Wire\utility\twi.c.o" "c:\Temp\arduino_build_187617\libraries\SPI\SPI.cpp.o" "-LC:\Users\Evgeny\Documents\Arduino\libraries\BSEC_Software_Library\src\atmega2560" -lalgobsec -lalgobsec "c:\Temp\arduino_build_187617/..\arduino_cache_163588\core\core_arduino_avr_mega_cpu_atmega2560_0c812875ac70eb4a9b385d8fb077f54c.a" "-Lc:\Temp\arduino_build_187617" -lm
c:\Temp\cc3ZKdIu.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_sketch_mar21a.ino.cpp.o.2348':

:(.text.startup+0x5c): undefined reference to `Bsec::Bsec()'

c:\Temp\cc3ZKdIu.ltrans0.ltrans.o: In function `main':

:(.text.startup+0x292): undefined reference to `Bsec::delay_ms(unsigned long)'

:(.text.startup+0x294): undefined reference to `Bsec::delay_ms(unsigned long)'

:(.text.startup+0x2a0): undefined reference to `Bsec::begin(unsigned char, SPIClass&, void (*)(unsigned long))'

:(.text.startup+0x36e): undefined reference to `Bsec::updateSubscription(bsec_virtual_sensor_t*, unsigned char, float)'

:(.text.startup+0x3a4): undefined reference to `Bsec::run(long long)'

collect2.exe: error: ld returned 1 exit status

Using library BSEC_Software_Library at version 1.5.1474 in folder: C:\Users\Evgeny\Documents\Arduino\libraries\BSEC_Software_Library
Using library Wire at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
exit status 1
Error compiling for board Arduino Mega or Mega 2560.
https://downloads.arduino.cc/libraries/library_index.json.sig file signature verification failed. File ignored.

downgraded to 1.8.11 working now

pre log mesage updated

pert:
The tool name arduinoOTA is correct. That is completely unrelated to the error you are getting. arduinoOTA is only used for uploading over the network. If there was a problem with arduinoOTA, it would cause an upload failure, not a compilation failure.

I'm pretty sure the bug you have encountered is this one:
"Improve precompiled libraries handling" broke "mixed code" libraries · Issue #353 · arduino/arduino-builder · GitHub
For now, the workaround you found of rolling back to Arduino IDE 1.8.11 is the best thing to do. The bug should be fixed in the next release of the Arduino IDE.

log mesage updated
Thenks

Visual Studio 2019 error
log in file

new_34.txt (35.4 KB)

Hi everyone,
I've the same problem with BME680 sensor and BSEC library.
I've followed the instruction of tutorial

I replaced the code in the the platform.txt

recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm

with

recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" {compiler.libraries.ldflags} "-L{build.path}" -lm

I Saved and restart Arduini IDE (ver 1.8.12)
I compiled Basic.ino but nothing
The output's compiler was

c:/users/......./arduino 1/arduino-1.8.11-windows/arduino-1.8.11/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: cannot find**-lalgobsec**

collect2.exe: error: ld returned 1 exit status

exit status 1
Errore durante la compilazione per la scheda Arduino Mega or Mega 2560.

I Download the Arduino IDE ver 1.8.11 and modified the platform.txt file but nothing else, i recieve the same complier's error.

Where i'm wrong?
Best Regardt