Compiling Error - 'Unable to rename core.a - permission denied'

Hey guys,

I just received my Arduino Uno R3 a few minutes ago and I've written my first program (basic flashing LED). However, when I try to compile my code I get the following error:

D:\Documents\Arduino\Arduino 1.0.2\hardware\tools\avr\bin\avr-ar: unable to rename 'core.a'; reason: Permission denied

This also happens when I try compiling one of the example programs. I've tried editing the permissions in the folder containing avr-ar to no avail.

Does anyone know how to fix this?

Thanks,

Felix

I've tried editing the permissions in the folder containing avr-ar to no avail.

Is that where core.a is? If not, then you are diddling with permissions on the wrong folder.

Enable verbose mode for compiling (File + Preferences) to get more details about what is going on.

Hey guys,

I just received my Arduino Uno R3 a few minutes ago and I've written my first program (basic flashing LED). However, when I try to compile my code I get the following error:

D:\Documents\Arduino\Arduino 1.0.2\hardware\tools\avr\bin\avr-ar: unable to rename 'core.a'; reason: Permission denied

This also happens when I try compiling one of the example programs. I've tried editing the permissions in the folder containing avr-ar to no avail.

Does anyone know how to fix this?

Thanks,

Felix

Post more info
Are you running windows 7?
Is there any firewall on your system?

For those like me, who still might run into this issue...
Just installed arduino IDE on my windows 7 laptop and ran into the same problem. After tinkering with multitude of security settings with my PC and in particular with the arduino directories and the specific "avr-ar.exe", the only temporary solution I could find was to launch arduino.exe in administrator mode. My actual windows login ID does have admin previlages but that does not suffice. :frowning:
I will investigate further and find a more elegant solution but for now the only way to make this compilation go through is to launch the arduino.exe by right clicking on it and selecting the option "Run as administrator".

I am surprised that more people aren't running into this issue and there is not much activity on this post.

If anybody else has found the specific root cause of this issue, I'd like to know.

Which folder are your sketches in ?

I moved the Arduino installation folder to various different locations like C:/ or "My Documents" or a shared drive. Same error.
I also moved around the sketches folder to various different locations mentioned above. Same error.
I tried to manually create a dummy core.a file into any of those folders. I was able to.
But still the compilation failed at the same step.

Arduino compiler is able to create the .o files in that same folder without trouble.
I tried manually executing avr-ar command per the arduino compiler log and that DID fail with the exact same error.

Looks like the avr-ar.exe, which is the final step of creating the archive, has some permission issues conflicting with either Windows or my Norton security settings. When I run the entire IDE as administrator, all the children processes assume the same permission level and are successful.
I may try to fiddle around with the properties of avr-ar.exe and see if that works.

Try temporarily disabling norton (there should be an option in there to disable it for a bit). It could well be that thinking it's doing something bad and stopping it.

Well I've got the same Core-A problem. Running Vista and Uno. I have BullGuard not Norton. This problem comes and goes for reasons I can't figure out.

You can try reading this post (I hope it's this the problem):
http://forum.arduino.cc/index.php?topic=95938.msg720346#msg720346

Open a command prompt
Type CD %temp%

In this folder, Arduino builds the sketches

You can also type %temp% in the explorer path for Vista, Win7/8, maybe XP

You can also from the command prompt, after the CD %temp% command, type "start ." (that is 'start' 'period' without the quotes) and press Enter key to start explorer in the current command directory.

Anyway, this is where the build process happens. On Vista and later, running Arduino with Administrator permissions ensures that the program can write, rename, and delete.

I have seen this happen on Vista without Norton/Symantec installed, only Microsoft Windows Essentials. In my case, it cured itself after a few seconds - I was doing back-back compiles; compile check then immediately compile upload. I suspect that the AV program had some files still tied-up and just have not released them (although the AV file scan architecture is suppose to prevent this issue.)

Recommend cleaning out your %temp% directory and then restarting Arduino. If problem continues, try turning off UAC, if continues, run Arduino as Administrator.

Ray

Disabling Notron & Microsoft Security Essentials didn't change the situation.

Finding temp folder is even easier. The temp folder location is viewable right there in the compiler log at the bottom of the IDE.
Funny thing is, Aarduino compiler creates its own temporary subfolder in the temp location, and that doesn't fail. The C++ compiler (gcc or g++) is able to create the .o files in this folder with no problems. Only when "avr-ar" is collecting the ".o"s to build the archive, that step fails to create the core.a
So, I don't think the folder permissions is an issue.

Anyway, I'm running out of ideas now :~ I haven't tried creating a new windows user and running Arduino in that user space. I don't want to bother with that.

For now I'm just going to run it as an administrator. That shouldn't create any security holes as Arduino IDE doesn't really communicate with the outside ("internet") world in any way.
Setting it up with admin previlages means simply right clicking on the exe and changing the properties. In the "Compatibility" toolbar there is a checkbox called "Run as administrator".

BTW, This thread should probably go into "Installation & Troubleshooting" forum rather than "Programming Questions".

Some time if you just execute the program with Administrator privilege, it stop saying that kind of message. So just right click on your program and chose the option "Execute as Administrator".

If you want a more permanent solution, go to the property of your program there is a section where you can tel windows to executed as Admin every time you run it.

How ever you will have to confirm the opening every time you start the program from then

FelixVanOost:
Hey guys,

I just received my Arduino Uno R3 a few minutes ago and I've written my first program (basic flashing LED). However, when I try to compile my code I get the following error:

D:\Documents\Arduino\Arduino 1.0.2\hardware\tools\avr\bin\avr-ar: unable to rename 'core.a'; reason: Permission denied

This also happens when I try compiling one of the example programs. I've tried editing the permissions in the folder containing avr-ar to no avail.

Does anyone know how to fix this?

Thanks,

Felix
[Just Run ARDUINO in ADMIN MODE, right click on the arduino file an click run as administrator ]

Hii

I faced this problem so many times . At that i simply cut my program from the current sketch to an new sketch and closed my previous sketch. Now if i upload the code in my new sketch it works. I hope it also work in your system.

Thank you

Arpit Gupta

The fact that Arduino haven't bothered to address this issue after many years is an absolute disgrace.

My friends I stopped the firewalls and antivirus and it stops giving the error.

Frédéric_Plante:
If you want a more permanent solution, go to the property of your program there is a section where you can tel windows to executed as Admin every time you run it.

I'm aware that it is an old thread, but I faced to the same problem, and I wish to share that the above tip nicely solved my problem.

I made the following:

Edit /Arduino/lib/preferences.txt, about line 50 uncomment build.path and put some folder you created before:

build.path=C:\someFolder\

Then open Arduino IDE and compile.

I solved this issue by disabling the firewall 'Bytefence'