Go Down

Topic: error: redefinition of 'void setup()'  (Read 374 times) previous topic - next topic

apollos68

Hi fellow arduinoer's. (hardware: arduino uno, com3) ( i did successfully do a 'tutorial 'blink upload,' successfully.)
                             
short explanation: want to upload txt file to arduino uno, receiving top 'subject' error.

1. ive read the instructions for the board and files. (although im just pasting the copied txt file)
2. ive read the 'sticky' on before posting.) \
3. i didn't do the 'compilation,' on upload, just the 'output.'
4. i didn't use '</>' cos i'm not sure what that 'verbose output.' is reproducing for coders needs.
4. ive posted an attachment of the 'txt,' file im trying to upload.
5. i think it's the extension .txt, not being ino. (what method to 'convert .txt to ino please if necessary)

suggestions appreciated please.



Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\evanna\Documents\Arduino\sketch_feb27a\sketch_feb27a.ino: In function 'void setup()':

sketch_feb27a:70:7: error: redefinition of 'void setup()'

 }void setup() {

       ^

C:\Users\evanna\Documents\Arduino\sketch_feb27a\sketch_feb27a.ino:10:6: note: 'void setup()' previously defined here

 void setup() {

      ^

C:\Users\evanna\Documents\Arduino\sketch_feb27a\sketch_feb27a.ino: In function 'void loop()':

sketch_feb27a:75:6: error: redefinition of 'void loop()'

 void loop() {

      ^

C:\Users\evanna\Documents\Arduino\sketch_feb27a\sketch_feb27a.ino:23:6: note: 'void loop()' previously defined here

 void loop()

      ^

exit status 1
redefinition of 'void setup()'

Invalid library found in C:\Users\evanna\Documents\Arduino\libraries\sketch_feb22c: no headers files (.h) found in C:\Users\evanna\Documents\Arduino\libraries\sketch_feb22c
Invalid library found in C:\Users\evanna\Documents\Arduino\libraries\sketch_feb22c: no headers files (.h) found in C:\Users\evanna\Documents\Arduino\libraries\sketch_feb22c

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

pert

The error output doesn't match your sketch. The error output says that this code is at line 70:
Code: [Select]
}void setup() {
However, in the file you attached, line 10 looks like this:
Code: [Select]
}
The error says this code is at line 75:
Code: [Select]
void loop() {
But the file you posted doesn't even have a line 75.

Please try compiling the code in the file that you attached. It should compile with no errors.

Go Up