arduino / arduino/Arduino

Windows 10 Arduino IDE compiles fail with unable to rename 'core\core.a'; reason: File exists

Open
#7,518 1 comment 1 reaction 0 assignees View on GitHub
Component: Compilation OS: Windows Type: Bug
Dominant language
Java
Stars
14.6k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

I am unable to use the Arduino IDE 1.8.5 on Windows 10. I was previously using it on Windows 7 with no problems, but when I tried moving to Windows 10 the Arduino IDE compiles began failing on Windows 10 with ...

c:\users\jim bayne\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2\bin\../lib/gcc/avr/4.9.2/../../../../avr/bin/ar.exe: unable to rename 'core\core.a'; reason: File exists

I had a similar problem with a VB project I was developing on Windows 10. There's a bug with the VB My.Computer.FileSystem.RenameFile (and probaly with the C++ equivalent) that was causing this. My solution was to use the File.Move function from the System.IO name space (ref: https://msdn.microsoft.com/en-us/library/system.io.file.move(v=vs.110).aspx ) e.g. ...

using namespace System::IO;
...
File::Move( path, path2 );
// e.g. File::Move( "D:\MyDirectory\OLD_FileName.txt", "D:\MyDirectory\NEW_FileName.txt" );

If path and path2 refer to the same directory (but have different file names), you end up with a rename, and avoid the File exists error.

Hope you're able to resolve this. The Arduino IDE is really great, and I would like to be able to continue using it on Windows 10.

Contributor guide

Open the contributing guide

Research direction

Reproduce the Arduino IDE 1.8.5 compile on Windows 10 and capture the reported avr/bin/ar.exe failure while renaming core\core.a. Investigate the Windows-specific rename behavior described in the issue; done means the IDE compiles successfully without the “File exists” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino
Domain
build-system, embedded-iot, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.