"Fatal Error: avr/pgmspace.h no such file or directory" error for ESP8266

Juraj:
the esp8266 core really contains that file in the 2.4.1 version
Arduino/cores/esp8266/avr at master · esp8266/Arduino · GitHub

That change was actually made after the 2.4.1 release so the current code will not work with ESP8266 core 2.4.1. With 2.4.1 or earlier you would do something like this:

#if defined(AVR)
#include <avr/pgmspace.h>
#else  //defined(AVR)
#include <pgmspace.h>
#endif  //defined(AVR)

but it's interesting to see they did that. It's how Arduino SAMD Boards and Arduino SAM boards works too so it probably makes sense.

1 Like