pert:
Try closing all Arduino IDE windows and then try again. That will clear the cache and hopefully fix the error.
Yup.
This happens when you have the IDE open for a long time, without compiling anything, and then try to compile a sketch. In the intervening time, windows has cleaned out the temp folder and so the cached core that the IDE expects to find (since it has compiled the core since last restart of the IDE).