Newby with basic compile issue(s).

I have tried to compile Blink.
Sometimes it works-sometimes it fails.
When it fails it is during

"Linking everything together..."

with the error

[path] cannot open output file [path] permission denied.

The little research I did indicated an "overzealous anti-virus program"

I have a real hard time with "intermittent" things like this....sometimes the voodoo works and sometimes it doesn't.

Looking for SOLID suggestions.

Thanks!

Make sure you and the Arduino IDE have write permissions to the folders in question.

That just doesn't smell right....if it were permissions, why would it succeed sometimes?

Also-the actual folder in question?

"-LC:\Users\User\AppData\Local\Temp\arduino_build_723164" -lm

Its a Temp folder built on the fly-how can I give Arduino permission to that?

No.

This is an intermittent problem. Mostly does NOT work-but every once in 6 (or so) compiles it magically goes thru

Its a Temp folder built on the fly-how can I give Arduino permission to that?

Which you failed to note in your first post.

Do you really want help, or just want to complain?

Please read and follow the directions in the "How to use this forum" post, for suggestions on how to post sensible requests for help.

I am sincerely seeking help.

I shall make absolutely certain not to ever direct any such requests towards you-as you somehow parse them as "complaints"

This is borderline bizarre at this point....

This is borderline bizarre at this point

Not at all.

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"

etc....

Computer world didnt used to be this way......

Great, please mark the thread "SOLVED" by editing the title of your first post.

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.

May also be called "real time" scanning.

It is, as I have stated several time, an intermittent problem.

Just because it somehow magically started working a few times in a row without one single change hardly qualifies as "SOLVED"

jremington:
Great, please mark the thread "SOLVED" by editing the title of your first post.

Nice!

Thx!

DrAzzy:
May also be called "real time" scanning.

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?

A 3rd party site that has more/better organized (more accessable) info than the McAfee "official" site?

Love it!

Thx.