Error compiling for board Arduino Mega or Mega 2560

Hi,

I am getting an error while upload any project in Arduion IDE as below...

I have tried uninstall and re-install the application but doesn't work..

Arduino: 1.8.12 (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

cc1.exe: fatal error: can't open 'C:\Users\Admin\AppData\Local\Temp\ccxCOanH.s' for writing: Permission denied

compilation terminated.

exit status 1
Error compiling for board Arduino Mega or Mega 2560.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Please help me to resolve this issue...

Thanks & Regards,
Santosh

can't open 'C:\Users\Admin\AppData\Local\Temp\ccxCOanH.s' for writing: Permission denied

I have seen similar error when an "on access" anti virus program was being used. The virus scanner has the file open for checking because it has been accessed thus preventing the compiler writing to it. Try temporarily stopping your anti virus program to see if it makes any difference

This is a bug. People had been reporting this over years. I haven't found one advise that works yet.

@foruonlyfrom007

There are lots of causes and different fixes.

Sometimes its the fault of the OS, Sometimes other software such as antivirus or similar.
But with there being so many causes we always ask you provide as much information as you can.
There are posts at the top of each forum section that explain what would be useful information.

But here are a couple of links for you.
Could you take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.