Go Down

Topic: Compiling Error - 'Unable to rename core.a - permission denied' (Read 2259 times) previous topic - next topic

Nov 25, 2012, 07:03 pm Last Edit: Nov 25, 2012, 07:11 pm by FelixVanOost Reason: 1
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

PaulS

Quote
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.


Cybernetician

Quote

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?

From Idea To Invention

tttt

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. :(
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.

UKHeliBob

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

tttt

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.


majenko

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. 

nid69ita

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

mrburnette

#9
Aug 24, 2013, 04:52 am Last Edit: Aug 24, 2013, 04:55 am by mrburnette Reason: 1
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' <space> '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

tttt

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".



tttt

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

Frédéric_Plante

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
As we fight our way northward into the great unknown, only that one thing remains certain...


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  ]

Go Up