Help! Error compiling for board Arduino Mega or Mega 2560

Hi @lelowijnands. The problem is you have two different versions of your sketch program in the same folder:

One is in the file named PultruStat_ver_1.6 - GF-PA6.ino:

and the other is in the file named PultruStat_ver_1.5.ino:

Because many sketches only contain a single .ino file, it's easy to assume that the .ino file is the sketch, but the sketch is actually the folder (C:\Users\lelow\Documents\TU TWENTE\MASTER\MSc THESIS\PultruStat_ver_1.5\PultruStat\ver_1.5\PultruStat_ver_1.5 in this case) and the sketch may contain multiple .ino files. These files are all concatenated into a single program before compiling, so when you put multiple copies of the same program in a sketch folder then you can get these "redefinition of..." errors.

The solution is to move the backup copies of the sketch to somewhere outside the sketch folder.

1 Like