Error messages using Arduino Uno: error: redefinition of 'void setup()'

Hello
Just started using my Arduino Uno today, from a Mac (Os 10.8.3).
I started by uploading successfully the sketch example Blink.ino.
I then proceeded to write the sketch of project Nr 02 that came with my Arduino package :

int switchState = 0;
void setup() {
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(2,INPUT);
}
void loop() {
switchState = digitalRead(2);
//
if (switchState == LOW) {
//
digitalWrite(3, HIGH); // LED green
digitalWrite(4, LOW); // LED red
digitalWrite(5, LOW); // LED red
}
else { // appui sur le bouton
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
delay(250); // wait for 1/4 sec
// faire clignoter les LEDs
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(250); // wait for 1/4 sec
}
} // end of loop

I got the following series of messages related to the void setup and voidloop functions:
[12/30/2015, 7:43:15 PM] - Start Building
[12/30/2015, 7:43:15 PM] - CPP File Created [/var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451500995421/projet-02.cpp]
[12/30/2015, 7:43:15 PM] - projet-02.cpp compiled
[12/30/2015, 7:43:15 PM] - Command failed: /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451500995421/projet-02.cpp: In function 'void setup()': /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451500995421/projet-02.cpp:37:6: error: redefinition of 'void setup()' void setup() { ^ /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451500995421/projet-02.cpp:24:6: error: 'void setup()' previously defined here void setup() { ^ /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451500995421/projet-02.cpp: In function 'void loop()': /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451500995421/projet-02.cpp:43:6: error: redefinition of 'void loop()' void loop() { ^ /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451500995421/projet-02.cpp:30:6: error: 'void loop()' previously defined here void loop() { ^ /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451500995421/projet-02.cpp: At global scope: /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451500995421/projet-02.cpp:64:10: error: expected constructor, destructor, or type conversion before '(' token pinMode(13, OUTPUT); ^ /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451500995421/projet-02.cpp:65:1: error: expected declaration before '}' token } ^

Since then I cannot upload again the Blink.ino sketch, due to the same kind of errors :

[12/30/2015, 7:43:57 PM] - Start Building
[12/30/2015, 7:43:57 PM] - CPP File Created [/var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451501037375/Blink.cpp]
[12/30/2015, 7:43:57 PM] - Blink.cpp compiled
[12/30/2015, 7:43:57 PM] - Command failed: /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451501037375/Blink.cpp: In function 'void setup()': /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451501037375/Blink.cpp:37:6: error: redefinition of 'void setup()' void setup() { ^ /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451501037375/Blink.cpp:24:6: error: 'void setup()' previously defined here void setup() { ^ /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451501037375/Blink.cpp: In function 'void loop()': /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451501037375/Blink.cpp:43:6: error: redefinition of 'void loop()' void loop() { ^ /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451501037375/Blink.cpp:30:6: error: 'void loop()' previously defined here void loop() { ^ /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451501037375/Blink.cpp: At global scope: /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451501037375/Blink.cpp:64:10: error: expected constructor, destructor, or type conversion before '(' token pinMode(13, OUTPUT); ^ /var/folders/0r/r3r2qgh1547_d1wwzz8rdv0h0000gq/T//build1451501037375/Blink.cpp:65:1: error: expected declaration before '}' token } ^

What do I need to reset or correct to upload the sketches ?

Thanks
Regards
VPx

First, please read this post, #7 specifically:

What version of the IDE are you using?

Hello,
Thanks for the tips about reporting code script and error messages. Will comply next time.

We are using the following IDE
ArduinoStudio
Version 0.0.5 edition 0.0.5-16058 (development 5627abc3e)
Dated: Thu Nov 19 2015 16:22:00 GMT+0100

For the time being, we have gotten around the problem by

  1. removing and reinstalling Arduinostudio
  2. writing our sketches directly in the original Blink.ino and not saving the sketch in the ArduinoStudio (we are saving them using Textedit application available on the Mac)

Thanks for any help you can bring us.
Regards,
VPx

vicpx:
We are using the following IDE
ArduinoStudio
Version 0.0.5 edition 0.0.5-16058 (development 5627abc3e)
Dated: Thu Nov 19 2015 16:22:00 GMT+0100

That's provided by arduino.org. It's a seperate project / company. You're better off asking in their forums.