• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Build Web Servers – Pg 42 – BME280 library

Q&A Forum › Category: ESP32 › Build Web Servers – Pg 42 – BME280 library
0 Vote Up Vote Down
Stephen asked 2 years ago

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

Question Tags: ESP32 BME280 Library error
3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

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

0 Vote Up Vote Down
Stephen answered 2 years ago

Thanks Sara,
Yes it’s clear, with the library deleted the program runs ok.
Stephen

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Great.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.