Nano #include <Arduino.h> compile error

I am getting this error when I try to compile a sketch for an Arduino Nano. It only happens on one of my Windows 10 computers, my other Windows computers have no issues. I am assuming it is some type of library issue.

Detecting libraries used...
C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\cores\arduino -IC:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\variants\eightanaloginputs C:\Users\John\AppData\Local\arduino\sketches\72AC36330D0A3BC87FA69DC1FAE70B00\sketch\RC_Battleship.ino.cpp -o nul
In file included from C:\Users\John\AppData\Local\arduino\sketches\72AC36330D0A3BC87FA69DC1FAE70B00\sketch\RC_Battleship.ino.cpp:1:0:
C:\Users\John\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\cores\arduino/Arduino.h:28:10: fatal error: avr/pgmspace.h: No such file or directory
#include <avr/pgmspace.h>
^~~~~~~~~~~~~~~~
compilation terminated.
Alternatives for avr/pgmspace.h: []
ResolveLibrary(avr/pgmspace.h)
-> candidates: []
exit status 1

A library problem wouldn't be my first bet. avr/pgmspace.h is an arduino:avr core file. At first glance that looks like an improperly installed core, or someone mucking around deleting files they shouldn't have.

Hi @madmcmac. This error might be caused by a problem with your installation of the "Arduino AVR Boards" platform, which adds support to Arduino IDE for use with the Nano board (as already said by @van_der_decken). If so, it may be possible to fix the problem by reinstalling the platform. I'll provide instructions you can follow to do that:

  1. Select Tools > Board > Boards Manager... from the Arduino IDE menus to open the "Boards Manager" view in the left side panel.
  2. Find the "Arduino AVR Boards" entry in the list of boards platforms.
  3. Hover the mouse pointer over the "Arduino AVR Boards" entry.
    You will see a ●●● icon appear at the top right corner of the entry.
  4. Click the ●●● icon.
    A menu will open.
  5. Select "Remove" from the menu.
    An "Uninstall" dialog will open.
  6. Click the "YES" button in the "Uninstall" dialog.
    The dialog will close.
  7. Wait for the uninstall process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    Successfully uninstalled platform ...

  8. Click the "INSTALL" button at the bottom of the "Arduino AVR Boards" entry.
  9. Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    Successfully installed platform ...

Now try compiling your sketch again, just the same as you did before. Hopefully this time everything will work as expected and you won't encounter that unexpected "avr/pgmspace.h: No such file or directory" error.

Thank you. Your advice worked.

You are welcome. I'm glad it is working now.

Regards, Per