We get beginners on the forum all the time who won't read the instructions, post no useful details about their problem, then get upset and argue when they don't get the answer they want.
Have you got "on access" scanning turned on in your anti virus program (McAfee perhaps) ? This causes the symptoms that you describe as McAfee has the file open for scanning when the IDE needs to access it. The IDE creates files in temporary directories so even if you can exclude certain directories from scanning it won't work.
I solved the problem by ditching McAfee and now use Windows Defender.
All the interesting banter about "how to ask questions properly" of all you high and mighty Arduino gurus aside....
....it just recompiled/ran at least a half-dozen times with no issue at all.
If anyone, every last particle in the Shroedinger space not completely defined, could possibly, oh I don't know....HAZARD A GUESS...as to what might cause an intermittent issue with the linker, I'd appreciate it and see it as a net positive in my quest.
This is a brand new MEGA2560 being run on Windows 10 (with the "latest updates") using all the default switches.
I have just been trying to run "Blink"-which must be the Arduino-world version of "Hello World!" and was hitting this snag...
History
I had the error maybe 3 or 4 times.
Came here-researched it and discovered I could get a more complete error output than "Error 1" or whatever it was failing with those times. And to my surprise-no only did the compiler show the line-by-line-the thing completed successfully and and device blinked.
Assuming (incorrectly) that it must have been something that magically "got fixed" when I set the 'more verbose error output' switch-I merrily went to boldly changing the blink delay parameter from 1000 to 5000-only to see the error crop up again.
Came to the forums a 2nd time and tried to find (needle in a haystack folks-by page 3? I was like "Naw-I'm actually gonna bite the damn bullet, "register" as a real user at arduino.com and become an OP.
Then? After politely asking what the issue might be?
I got messages moved.
Told my sincere requests for info were "complaints"
This sounds promising-of course I went to McAfee and did the whole, FAQ, forum, shebang-and couldn't find anything related to "on access" scanning....
Would that possibly come under some other name?
Or, better, do you know enough about McAfee to let me know how to toggle this?
UKHeliBob:
Have you got "on access" scanning turned on in your anti virus program (McAfee perhaps) ? This causes the symptoms that you describe as McAfee has the file open for scanning when the IDE needs to access it. The IDE creates files in temporary directories so even if you can exclude certain directories from scanning it won't work.
I solved the problem by ditching McAfee and now use Windows Defender.
Arduino_Chuck:
This sounds promising-of course I went to McAfee and did the whole, FAQ, forum, shebang-and couldn't find anything related to "on access" scanning....
Would that possibly come under some other name?
Or, better, do you know enough about McAfee to let me know how to toggle this?