1.8.3 IDE -- Trying to compile simple switch debounce sketch (search ARDUINO DEBOUNCE).
Selected Board = Arduino/Genuino Micro.
Compile fails and reports the following:
"GetFileAttributesEx C:\Users\xxxxx\AppData\Local\Temp\arduino_cache_643416: The system cannot find the file specified.
Error compiling for board Arduino/Genuino Micro."
Searching the target folder and there are NO "Arduino_cache..." files.
Tried to Compile on the Arduino Nano (yes, selected Arduino Nano from TOOLS -> Board.)
Same failure message: "Error compiling for board Arduino Nano".
Since this thread comes up when googling for GetFileAttributesEx & arduino_cache let me answer just in case. The code is irrelevant (though the sentiment of having us google it is indeed not very nice). The error occures if the temp files are deleted and a file is open but not saved to the filesystem. Since it is Windows the most likely culprit is either one of those horrific computer cleanup suites or something more manual like Crap Cleaner. The solution is easy. Save and restart the Arduino IDE.
This seems like quite a reasonable request for help to me
Assuming that the poster is trying to compile the Examples>Digitals
Debounce or anything else come to that, it should be obvious that what he/she is asking about is the compile error as stated.
I can confirm that this error is a pain and a recent one at that. I find that sketches compile for a couple of days without a problem, then you get this wretched GetFileAttributesEx error.
I can't put my finger on exactly when this started, but it has to be in the region of 1-year and somewhere between 1.6.7 and 1.8.4. I'm running Win 10 1709 (last feature update) and 1703. The PC runs continuously, no restarts etc. other than MS updates.
On starting the IDE, the sketch appears to rebuild and allocate a new temporary file in arduino_cache etc.This works for a couple of days before you get the error. Only by restarting the IDE does the same sketch compile, only to fail again days later. There is no trace of the original file in the cache folder.
This affects all types of sketches whether home-grown or IDE examples - posting the code or not isn't the issue.
You can end up with several instances of the IDE running with a sketch compiling in one and not the other.
Some of the "solutions" like compiling with another board then trying again with the correct board don't work - only restarting the IDE clears it.
I wonder if this is related to having library updates available. I sometimes run into this problem and as you mentioned, have to restart my arduino ide, and when I do, the message "updates available for some of your libraries" (or something similar) is always there waiting. Then, whether I update or not, I can compile the program normally.