Error compiling for board Arduino Uno; Exit status 1

Hello.
I’m a bit new to Arduino.
I’m working on this project when this error suddenly comes up when compiling.

I am using an Arduino UNO board and the Arduino 1.8.13 IDE and the error says “exit status 1; error compiling for board Arduino UNO”.

It’s confusing to me because I have been working on this project for a while without anything of the sort. In fact, I was done with the project but just decided to change the LCD screen I was using from 16 by 2 to 20 by 4. I also changed my matrix keypad to a different one which had a different layout so I had to change the character mapping to the keys on the newer one.

This was all I did to make this error start popping up. After going through the forum, I deleted the Arduino15 folder and even did a clean reinstall of the program but it persists. Even after reverting, the problem remains.

Here’s my code in case that’s where the problem is from but it’s a bit lengthy.
Also, I’m yet to optimize it finally.
I’ll attach it also.

So I tried using code tags but it exceeds the character limit so it’s just attached.

Project_Working_-basic__added_master.ino|attachment (25.6 KB)

judahben149:
the error says "exit status 1; error compiling for board Arduino UNO".

There is surely much more to it than that. What you have posted only tell us that something went wrong when compiling. There are an infinite number of possible causes of this generic error message. You need to scroll up the black console pane at the bottom of the Arduino IDE window to see the specific error messages that will tell you what went wrong.

After studying those, if you still can't find the solution, feel free to post the full and exact text of the error output here and we'll help you out.

Compiled fine for me

Sketch uses 14454 bytes (44%) of program storage space. Maximum is 32256 bytes.
Global variables use 1777 bytes (86%) of dynamic memory, leaving 271 bytes for local variables. Maximum is 2048 bytes.
Low memory available, stability problems may occur.

I really don't know why it's doing this. I've reinstalled again. Even installed an older version but still, it persists.

I enabled verbose during compilation and I the only difference is that it shows me the libraries in use and they correspond to the libraries I used.

When I check the messages at the console when compiling, I get some really long lines(about 850).
This is a small cut of what most of the lines look like.

C:\Users\Judah\Desktop\Project work\Codes and tests\Project_Working_-_basic__added_master_\Project final 1.ino: In function 'void confirmation()':

C:\Users\Judah\Desktop\Project work\Codes and tests\Project_Working_-_basic__added_master_\Project final 1.ino:607:6: error: redefinition of 'void confirmation()'

 void confirmation() {

      ^~~~~~~~~~~~

C:\Users\Judah\Desktop\Project work\Codes and tests\Project_Working_-_basic__added_master_\Project_Working_-_basic__added_master_.ino:611:6: note: 'void confirmation()' previously defined here

 void confirmation() {

      ^~~~~~~~~~~~

C:\Users\Judah\Desktop\Project work\Codes and tests\Project_Working_-_basic__added_master_\Project final 1.ino: In function 'void ussdrecharge()':

C:\Users\Judah\Desktop\Project work\Codes and tests\Project_Working_-_basic__added_master_\Project final 1.ino:623:6: error: redefinition of 'void ussdrecharge()'

You have two files in your sketch:

  • C:\Users\Judah\Desktop\Project work\Codes and tests\Project_Working_-basic__added_master\Project final 1.ino
  • C:\Users\Judah\Desktop\Project work\Codes and tests\Project_Working_-basic__added_master\Project_Working_-basic__added_master.ino

Because many Arduino sketches are only a single .ino file, it's easy to assume that the .ino file is the sketch, but it's actually the folder that is the sketch (C:\Users\Judah\Desktop\Project work\Codes and tests\Project_Working_-basic__added_master). All the .ino files in that folder are compiled as a single program. You will see these files in the Arduino IDE as tabs (though I'm not sure how it handles the filename with prohibited spaces, so maybe it's not shown in this case).

I suspect that you made a copy of your .ino file as a crude backup and left it in the sketch file. So you have two definitions of some of the code: one in your working copy file and the other in the backup file.

The solution is to move the backup files out of the sketch folder.

It's fixed :smiley:
That was exactly the problem.

I duplicated it before making changes so I wouldn't mess up the working code.
Thank you so much @ Pert.

You're welcome. I'm glad to hear it's working now. Enjoy!
Per