(I looked first if others had this problem but could not find it here.)
So I’ve got a Compiler error:
/home/erik/SynologyDrive/Arduino/libraries/Adafruit_Sensor/Adafruit_Sensor.cpp:2:10: fatal error: avr/pgmspace.h: No such file or directory
2 | #include <avr/pgmspace.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Ebook: Learn LVGL: Build GUIs for ESP32 Projects, PAGE: 162
I found a solution after some searching:
REMOVE the #include <avr/pgmspace.h> line from Adafruit_Sensor.cpp
OR change the line to: #include <pgmspace.h>
Adafruit_Sensor.cpp content: /home/erik/SynologyDrive/Arduino/libraries/Adafruit_Sensor
——————————————————————
#include “Adafruit_Sensor.h”
#include <avr/pgmspace.h>
void Adafruit_Sensor::constructor() {
}
So AFTER the mentioned changes compiling is OK and everything seems to be working.
But this is not as it should be??
What could be the matter?
Thanks, Erik
MY (Linux Mint) SETUP:
ARDUINO IDE:
——————
Version: 2.3.2
Date: 2024-02-20T09:54:08.669Z
CLI Version: 0.35.3
Copyright © 2024 Arduino SA
Arduino IDE: Additional Boards Manager URLs:
———————————————————————-
http://arduino.esp8266.com/stable/package_esp8266com_index.json
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
Adafruit BME280 Library: v. 2.2.4 including dependancies
——————————————————————–
/home/erik/SynologyDrive/Arduino/libraries/Adafruit_BME280_Library
/home/erik/SynologyDrive/Arduino/libraries/Adafruit_Sensor
/home/erik/SynologyDrive/Arduino/libraries/Adafruit_Unified_Sensor
Compiler ERROR MESSAGE:
———————————————————————–
avr/pgmspace.h: No such file or directory
2 | #include <avr/pgmspace.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: exit status 1
Hello Erik,
You shouldn’t need to modify any files from those libraries and they should compile by default. Go to “Library Manager” and search for these libraries to check if you have these versions that you have installed
- Adafruit BME280 Library 2.2.4
- Adafruit Unified Sensor 1.1.14
- Adafruit BusIO 1.16.1
If you’ve made changes to those libraries, I recommend removing them and re-installing them again.
Yes I have the latest versions. Before asking this question, to be sure, I removed the BME280 2.2.4 lib via the library manager and reinstalled version 2.2.4 which also installed the other libs. The versions are OK, as you pointed out.
No problem, I know now where to look if I use the BME280 and normally I code in VSCode/PlatformIO without this problem so let this not take anymore of your time. I only use the Arduino IDE to follow the Ebook
I just wanted to know if I had overlooked something.
Thank you very much for your help!