/avr/bin/ar.exe: unable to rename 'core\core.a'; reason: File exists
C:\Program Files (x86)\Arduino\libraries\SD\src\utility/Sd2Card.cpp:184: undefined reference to `digitalWrite'
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.Which version of the Arduino IDE are you using?