What is happening is, in the library you have included, another library is included. There are 2 solutions: delete the #include pgmspace.h within one of those libraries or just get pgmspace.h. Hope this helps!

Answer from Iliketurtles on Stack Exchange
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Library pgmspace - Programming - Arduino Forum
January 15, 2023 - Hi everyone, I have a problem; I have an error which tells me this: and I couldn't find this library, it's my first time receiving this type or error. c:\Users\alexi\OneDrive\Documents\Arduino\libraries\Adafruit_SSD1306\Adafruit_SSD1306.cpp:42:10: fatal error: pgmspace.h: No such file or directory #include ^~~~~~~~~~~~ compilation terminated. exit status 1 Compilation error: exit status 1
Discussions

ESP32 boards: `#include <avr/pgmspace.h>` results in `fatal error: avr/pgmspace.h: No such file or directory -> candidates: []`
#include compiles on all supported processors and architectures except ESP32. It is probably related to location of this file within the esp32 toolchain. The toolchain for al... More on github.com
🌐 github.com
2
January 8, 2022
Fatal error: pgmspace.h: No such file or directory Help!
There are several lines of code ... is fine. However, if I use the arduino board MKR wifi 1010 then it shows that fatal error: pgmspace.h: No such file or directory I commented out these two lines #include and ...... More on forum.arduino.cc
🌐 forum.arduino.cc
0
0
October 31, 2022
esp32 - I2C_graphical_LCD_display, fatal error: avr/pgmspace.h: No such file or directory - Arduino Stack Exchange
C: \ Users \ Topolino \ Documents \ Arduino \ libraries \ I2C_graphical_LCD_display-master / I2C_graphical_LCD_display.h: 62: 26: fatal error: avr / pgmspace.h : No such file or directory. Compilation terminated. More on arduino.stackexchange.com
🌐 arduino.stackexchange.com
fatal error: pgmspace.h: No such file or directory
I'm using FastCRC as a library in Arduino to calculate CRC. It works great on my Teensy 3.6, and I think this library has a hardware and software "version" and that the Teensy can utilize the hardware calculations with its built in crc hardware. The problem I'm having is that I'm trying to ... More on forum.arduino.cc
🌐 forum.arduino.cc
0
0
June 13, 2019
🌐
Arduino Forum
forum.arduino.cc › projects › programming
"Fatal Error: avr/pgmspace.h no such file or directory" error for ESP8266 - Programming - Arduino Forum
July 25, 2018 - Hi! I am using Arduino IDE to program my NodeMCU module. I am trying to interface seven segment display using MAX7219 IC. FOr that I am using LedControl library from here. I have seen people using LedControl library with their ESP8266 but my IDE is refusing to compile it.
🌐
GitHub
github.com › arduino › Arduino › issues › 11736
ESP32 boards: `#include <avr/pgmspace.h>` results in `fatal error: avr/pgmspace.h: No such file or directory -> candidates: []` · Issue #11736 · arduino/Arduino
January 8, 2022 - The toolchain for all other processors and architectures (avr, arm, Intel and even esp8266) provide this file under path .../packages/.../avr/pgmspace.h, but esp32 toolchain provides it under path .../packages/esp32/hardware/esp32/1.0.6/cores/esp32/pgmspace.h which prevents compiling otherwise compatible sketches and libraries.
Author   dmalenic
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Fatal error: pgmspace.h: No such file or directory Help! - Programming - Arduino Forum
October 31, 2022 - There are several lines of code ... is fine. However, if I use the arduino board MKR wifi 1010 then it shows that fatal error: pgmspace.h: No such file or directory I commented out these two lines #include and ......
🌐
Arduino Forum
forum.arduino.cc › projects › programming
fatal error: pgmspace.h: No such file or directory - Programming - Arduino Forum
June 13, 2019 - I'm using FastCRC as a library in Arduino to calculate CRC. It works great on my Teensy 3.6, and I think this library has a hardware and software "version" and that the Teensy can utilize the hardware calculations with its built in crc hardware. The problem I'm having is that I'm trying to use this FastCRC library on my nRF52840, but I get the following error: In file included from C:\Users\Mariu\Documents\Arduino\libraries\FastCRC2\FastCRCsw.cpp:38:0: C:\Users\Mariu\Documents\Arduino\librarie...
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Sys/pgmspace.h no such file - Programming - Arduino Forum
May 20, 2022 - I'm using Arch Linux. When I try to compile code, it output error: In file included from /home/guts/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/Arduino.h:283, from sketch/sketch_may20a.ino.cpp:1: /home/guts/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/pgmspace.h:8:10: fatal error: sys/pgmspace.h: No such file or directory #include ^~~~~~~~~~~~~~~~ compilation terminated. exit status 1 Error compiling for board...
Find elsewhere
🌐
GitHub
github.com › SodaqMoja › Sodaq_DS3231 › issues › 5
"avr/pgmspace.h: No such file or directory" on ESP8266. Patch inside. · Issue #5 · SodaqMoja/Sodaq_DS3231
April 6, 2016 - Hi! I am using this library together with my NodeMCU and other ESP8266-12 modules. But the library/compiler throws the following error: "fatal error: avr/pgmspace.h: No such file or directory". I found the following solution: In Sodaq_DS...
Author   ikarisan
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Use of Adafruit_SH1106 library cause fatal error: avr/pgmspace.h: No such file or directory compilation terminated - Programming - Arduino Forum
June 5, 2021 - Hi all, I'm implementing a simple internet radio based on ESP32. The original project, not mine, uses an SSD1306 based OLED display and, so far, it seems to work. The display is driven through libraries Adafruit_GFX and Adafruit_SSD1306. Unfortunately I've only a very small SSD1306 OLED display and I've switched to bigger OLED display driven by an SH1106.
🌐
Particle
community.particle.io › firmware › libraries
<avr/pgmspace.h> no such file or directory running particle could on Raspberry pi3 - Libraries - Particle
May 1, 2017 - Hi, i’m trying to flash an arduino program to my raspberry pi3 through Particle cloud ide. The cloud has my pi device recognized. But when i tried to flash the program to the pi. I got an error saying: “Print.h” no such file or directory. So i googled to copy the Print.h and Print.cpp ...
🌐
M5Stack Community
community.m5stack.com › topic › 729 › fatal-error-pgmspace-h-no-such-file-or-directory
fatal error: pgmspace.h: No such file or directory | M5Stack Community
March 5, 2019 - Using library M5Stack-master at version 0.2.5 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\M5Stack-master exit status 1 Error compiling for board Arduino Pro or Pro Mini. ... Error compiling for board Arduino Pro or Pro Mini. In your error log it says you are compiling for arduino pro "Error compiling for board Arduino Pro or Pro Mini." I imagine since your on the m5stack forums that you are not trying to program an arduino board.
🌐
EEVblog
eevblog.com › forum › beginners › why-is-this-error-in-this-arduino-program-397458
why is this error in this arduino program? - avr/pgmspace.h
October 18, 2023 - EEVblog Captcha · We have seen a lot of robot like traffic coming from your IP range, please confirm you're not a robot · This security check has been powered by · CrowdSec
🌐
Arduino Forum
forum.arduino.cc › projects › programming
arduino v1.0 compile error: avr\pgmspace.h: No such file or directory - Programming - Arduino Forum
January 10, 2012 - I am new to Arduino. I've installed the Arduino IDE 1.0 on a MacOSX platform and have been checking out Mikal Hart's TinyGPS package. http://arduiniana.org/libraries/tinygps/ http://arduiniana.org/TinyGPS/TinyGPS10.zip However I'm encountering a compile error with one of the example sketches ...
🌐
Arduino Forum
forum.arduino.cc › international › italiano › software
fatal error: avr\pgmspace.h: No such file or directory - Software - Arduino Forum
July 10, 2013 - Salve a tutti, sto cercando di compilare uno sketch per mettere ora e data su un display LCD. Fortunatamente ho trovato uno sketch sul web che mi potrebbe essere utile (enc28j60_tutorial/_13_NTP.ino at master · lucadentella/enc28j60_tutorial · GitHub), ma quando cerco di compilarlo mi da: ...EtherCard.h:37: fatal error: avr\pgmspace.h: No such file or directory Ho controllato su tutte le cartelle avr di Arduino e il file in questione sembra esserci...
🌐
The Things Network
thethingsnetwork.org › end devices (nodes)
Pgmspace.h: No such file or directory - End Devices (Nodes) - The Things Network
October 5, 2018 - Hi, i am trying the Arduino sketch DeviceInfo for LoRaExplorer. The comilation fails: TheThingsNetwork.h:12:22: fatal error: pgmspace.h: No such file or directory I follow all the instruction to install TheThingsNEtwo…
🌐
GitHub
github.com › TheThingsNetwork › arduino-device-lib › issues › 241
ESP32 doesn't compile · Issue #241 · TheThingsNetwork/arduino-device-lib
August 9, 2018 - I wanted to compile the Code for an Heltec-ESP32-Module and got the error: /Arduino/libraries/TheThingsNetwork/src/TheThingsNetwork.h:9:26: fatal error: avr/pgmspace.h: No such file or directory
Author   jstrobel
Top answer
1 of 4
8

Based on the responses to this issue, I added "c:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\\avr\\**" to my include path in c_cpp_properties.json:

"includePath": [
    "c:\\Program Files (x86)\\Arduino\\tools\\**",
    "c:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\**",
    "c:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr\\avr\\**"
],
2 of 4
6

For anyone who stumbles here on a Mac, here is the config that works for me with the Uno:

{
    "env": {
        "arduino_path": "/Applications/Arduino.app/Contents/Java",
        "arduino_avr_include_path": "${env:arduino_path}/hardware/arduino/avr",
        "arduino_avr_include2_path": "${env:arduino_path}/hardware/tools/avr/avr/include",
        "arduino_avr_compiler_path": "${env:arduino_path}/hardware/tools/avr/bin/avr-g++"
    },
    "configurations": [
        {
            "name": "Mac",
            "defines": [
                "ARDUINO=10810",
                "__AVR_ATmega328P__",
                "UBRRH"
            ],
            "includePath": [
                "${workspaceRoot}",
                "${env:arduino_avr_include_path}/**",
                "${env:arduino_avr_include2_path}/**"
            ],
            "forcedInclude": [
                "/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h"
            ],
            "intelliSenseMode": "gcc-x64",
            "cStandard": "c11",
            "cppStandard": "c++11",
            "compilerPath": "${env:arduino_compiler_path} -std=gnu++11 -mmcu=atmega328p"
        }
    ],
    "version": 4
}

The key to finding <avr/pgmspace.h> was the adding the hardware/tools/avr/avr/include path.

Defining ARDUINO=10810 was identified from the output of running Arduino: Verify with the verbose flag.

Defining __AVR_ATmega328P__ was added to allow proper IntelliSense completion of the raw register macros (e.g. _BV(), OCR0A, TIMSK0, etc.); the correct macro to define was identified based on the chip being an ATMEGA328P-PU and by inspection of the file hardware/tools/avr/avr/include/avr/io.h.