This sort of error could be caused by your antivirus software. Try TEMPORARILY disabling your antivirus for a single compilation to see if the problem goes away, then turn the antivirus back on. If the problem doesn't occur with the antivirus off you will need to adjust the settings of your antivirus to whitelist the appropriate file, folder, or process so it doesn't interfere with compilation.
Hi, I´m using McAfee but I don´t think my problem is related to the AV as I have used the same computer and software since more than a year without problem and now it just happens. The only thing that I can think of that has changed lately is that I have been running wifi-projects including the ESP8266.
I have uninstalled the IDE, deleted libraries and tried again with the same outcome.