Arduino IDE

Ok, I'm new to all of this. I'm trying to compile firmware for my 3d printer to flash it. I keep getting the error -

Arduino: 1.8.7 (Windows Store 1.8.15.0) (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

c:\program files\windowsapps\arduinollc.arduinoide_1.8.15.0_x86__mdqgnx93n4wtt\hardware\tools\avr\bin../lib/gcc/avr/5.4.0/../../../../avr/bin/ar.exe: unable to rename 'core\core.a'; reason: File exists

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

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

I've tried uninstalling Arduino and Marlin - no luck - any suggestions? Thanks in advance!

The first I see is a problem using Windows. Win10 is a great mistake, trying to simplify things for people but instead making things confusing for many more.
I Think You need to get that sorted out first, getting the files to their proper place first.
Then test to compile Your sketch.

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.

@pert
Thanks!