Error compiling project

I am getting these errors when compiling the code of my arduino traffic light project:

Arduino: 1.6.3 (Windows Vista), Board: “Arduino Uno”

C:\Program Files\Arduino\hardware\tools\avr\bin\avr-ar: unable to rename ‘C:\Users\Shane1\AppData\Local\Temp\build6555032079637127601.tmp/core.a’; reason: File exists

Error compiling.

c:/program files/arduino/hardware/tools/avr/bin/…/lib/gcc/avr/4.8.1/…/…/…/…/avr/lib/avr5/crtm328p.o:(.init9+0x0): undefined reference to `main’

collect2.exe: error: ld returned 1 exit status

Error compiling.

C:\Program Files\Arduino\hardware\tools\avr\bin\avr-ar: unable to rename ‘C:\Users\Shane1\AppData\Local\Temp\build6555032079637127601.tmp/core.a’; reason: File exists

Error compiling.

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x73

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x73

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x73

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x73

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x73

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x73

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x73

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x73

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x73

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x73

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.

And also this:

Arduino: 1.6.3 (Windows Vista), Board: “Arduino Uno”

C:\Program Files\Arduino\hardware\tools\avr\bin\avr-ar: unable to rename ‘C:\Users\Shane1\AppData\Local\Temp\build6555032079637127601.tmp/core.a’; reason: File exists

Error compiling.

c:/program files/arduino/hardware/tools/avr/bin/…/lib/gcc/avr/4.8.1/…/…/…/…/avr/lib/avr5/crtm328p.o:(.init9+0x0): undefined reference to `main’

collect2.exe: error: ld returned 1 exit status

Error compiling.

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.

Any help would be appreciated.

Can you compile and upload the Blink Example?

Are you using any extra libraries?

undefined reference to `main'

Do you have "main" anywhere in your code?

Did you try to upload any other Arduino project?

Thanks for your responses.

Blink does work. I had it working on the old IDE before I updated it to 1.6.3.

I am trying to get this code to work: int red = 13; int yellow = 12; int green = 11;

void setup(){ pinMode(red,OUTPUT); pinMode(yellow,OUTPUT); pinMode(green,OUTPUT); } void loop(){ changeLights(); delay(15000); }

void changeLights(){ // green off, yellow for 3 seconds digitalWrite(green,HIGH); digitalWrite(yellow,LOW); delay(3000);

// turn off yellow, then turn red on for 5 seconds digitalWrite(yellow,LOW); digitalWrite(red,HIGH); delay(5000);

// red and yellow on for 2 seconds (red is already on though) digitalWrite(yellow,HIGH); delay(2000);

// turn off red and yellow, then turn on green digitalWrite(yellow,LOW); digitalWrite(red,LOW); digitalWrite(green,HIGH); }

Thanks Shane.

Nothing wrong with that code, it compiles. Maybe you have not installed the Arduino IDE correctly.

I will try install it again, thanks for your help.

scusack57: I will try install it again, thanks for your help.

Let us know what happens..

i have the same problem
Arduino: 1.6.6 (Windows 10), Board: “Arduino/Genuino Micro”

Sketch uses 5,076 bytes (17%) of program storage space. Maximum is 28,672 bytes.
Global variables use 157 bytes (6%) of dynamic memory, leaving 2,403 bytes for local variables. Maximum is 2,560 bytes.
avrdude: butterfly_recv(): programmer is not responding
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.

this is the code

Arduino: 1.6.6 (Windows 10), Board: “Arduino/Genuino Micro”

Sketch uses 5,076 bytes (17%) of program storage space. Maximum is 28,672 bytes.
Global variables use 157 bytes (6%) of dynamic memory, leaving 2,403 bytes for local variables. Maximum is 2,560 bytes.
avrdude: butterfly_recv(): programmer is not responding
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.

Programmer not responding means your Arduino is not working for some reason, it is nothing to do with your code.