Hello All,
Blink LED uploaded ok till I added the Adafruit BME280 Library, after which it would not compile, with the following error message…
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\liba38\Adafruit BME280 Library\Adafruit_BME280.cpp.o
In file included from .pio/libdeps/esp32doit-devkit-v1/Adafruit BME280 Library/Adafruit_BME280.cpp:31:
.pio/libdeps/esp32doit-devkit-v1/Adafruit BME280 Library/Adafruit_BME280.h:26:10: fatal error: Adafruit_I2CDevice.h: No such file or directory
****************************************************************************
* Looking for Adafruit_I2CDevice.h dependency? Check our library registry!
*
* CLI > platformio lib search “header:Adafruit_I2CDevice.h”
* Web > https://registry.platformio.org/search?q=header:Adafruit_I2CDevice.h
*
****************************************************************************
#include <Adafruit_I2CDevice.h>
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\esp32doit-devkit-v1\liba38\Adafruit BME280 Library\Adafruit_BME280.cpp.o] Error 1
======================== [FAILED] Took 2.06 seconds ========================
If I comment out the line in the line in ‘platformio.ini’ file…
;lib_deps = adafruit/Adafruit BME280 Library@^2.2.2
the program compiles and uploads ok.
Can you please explain?
Thanks, Stephen
Hi Stephen.
At that stage of the eBook, I’m just showing how you would need to proceed if you wanted to add that library. It’s not to add that library to all your projects. I’m sorry if that section is not clear.
The program will throw an error if you include libraries in the platformio.ini file that you don’t use in your code. So, if you’re running the blink LED project with that library included on the platformio.ini file, you’ll get an error. Delete the library from the platformio.ini file and it should compile just fine.
Let me know if this is clear or if you need further assistance.
Regards,
Sara
Thanks Sara,
Yes it’s clear, with the library deleted the program runs ok.
Stephen