Error compiling for board XXXX

Hi all --

I've been having an issue that comes and goes -- but seems to be coming now more and more frequently. Often when I compile I get:

"Error compiling for board Arduino Nano"

There is nothing else given even when preferences for verbosity is set to the highest setting. It is not an error with the code. I've opened a new sketch that only has an empty setup and loop and I still get this. If I reboot and bring it up again it will compile just fine. The next time it will fail again. I'm not talking about uploading... just compiling. (It does the same thing when trying to upload, though).

It's driving me crazy that I have to keep rebooting just to get in a compile.

I think it started when I tried to upgrade to the new version 1.8.5. At the same time I followed this instructable so I could start programming to a WEMO board. https://www.instructables.com/id/Wemos-ESP8266-Getting-Started-Guide-Wemos-101/. For this I had to download a driver CH340G driver, and also some libraries. I don't really remember what I did -- but I followed the directions in the instructable. I'm pretty good at coding -- but not so hot at drivers/registry's/etc...

After doing this, I successfully coded/compiled/uploaded to a WEMO twice.

Around this same time (maybe?) it started getting obnoxiously long to compile. Sometimes it could take 10 minutes or more. I've since tried to turn off McAffee and that seemed to help some, but still getting the "Error compiling for board Arduino XXX" every other time I compile. (No matter what board I'm trying to compile for.)

I noticed that my older version of the IDE was still around, so I tried to uninstall it.

Any one have any advice? I'm hoping for a simple solution. If one answer is to uninstall and reinstall 1.8.5 (or whatever the latest is) then will I lose all the libraries I've downloaded for various projects?

This is Windows, right? Which version?

10 minute compile time is crazy. Something is very wrong.

Usually libraries you install are in the sketchbook libraries folder, which on Windows defaults to {Documents}/Arduino/libraries. If the libs you installed are in that folder, reinstalling Arduino won't affect them.

Some antivirus programs have what I can only describe as as "failsafe" to prevent total shutdown of the program.

It is feasible that Mcafee has something similar although it is a long time since I used that bloatware.
If it is Windows you are using then check the services list and task manager to make sure it is off completely.
If it does help you should add the Arduino IDE to the exclusions list in your antivirus.

It may also be worth turning off the option in the IDE preferences for "Check for updates on startup" to see if that helps as some users have said it did.

Additionally if you want to do a real clean up and re-install I am attaching some helpful instructions

CLEAN UP BEFORE INSTALLING ANOTHER COPY OF THE IDE OR ARDUINO CREATE.pdf (345 KB)

I have Windows 10

Thanks for the responses. I'm not sure why today is different. I made double sure that I turned McAffee real time scanning off. Also, maybe it's that I'm not home and not using my usual wifi??

I was going to uninstall and reinstall following the advice of above. But when I went through the control panel -- arduino ide was not listed in programs. Seems very suspicious to me - but I didn't know what to do, so I didn't uninstall afterall.

So, I just decided to try again. I had two programs I was working on -- the first for an Arduino Nano. Compile times returned to normal. I had an error while uploading, but that had to do with selecting ATmega328P (old bootleg) or something like that. So, got it to work.

Now, attempted to compile a program to a WeMos D1 mini. Amazingly it compiled just fine. Then tried to upload. Now it gave me the "Error compiling for board ..." error. I had changed the preferences to write out verbosely -- but it was just warnings. I changed from compiling for WeMos D1 mini pro to WeMos D1 R2 & mini, but same thing -- it gave me the "Error compiling for board ..." error.. So, I rebooted and tried again -- and this time it uploaded.

So, it's running faster, and I actually got it to upload... but it still seems flaky.

Try adding the following locations to Mcafees exclusions / whitelist

C:\Users\name\AppData\Local\Arduino15
C:\Users\name\AppData\Roaming\Arduino15
C:\Program Files (x86)\Arduino

If you installed to a different location then swap the drive letters accordingly.