Read the first error, not the last line. “Exit status 1” only says the build failed.
What the message means
One missing symbol can cause a chain of later messages. Fixing the first one often clears them all.
Fix it in this order
- Turn on verbose output or scroll the console to the first error.
- Check the line number shown and the line above it.
- Look for a missing semicolon, bracket or quote.
- Check that every function and variable is declared before use.
- Confirm the right board is selected for the code.
- Update or reinstall the library named in the error.
Why it happens
The line “exit status 1” only says the build failed. The real reason is higher up in the output, in the first error message, and the lines after it are often caused by it.
Turn on verbose output in the IDE if needed, scroll to the first line marked error, and fix that one first. Typical causes are a missing library, a missing semicolon, or the wrong board selected.
If you see this, do this
| You see | Do this |
|---|---|
| Many errors at once | Fix the first one. |
| Not declared in this scope | Missing include or typo. |
Related
library not found, library not compatible.
Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.
Why this happens
The Arduino IDE calls a compiler, and ‘exit status 1’ is the compiler telling the IDE that it stopped with an error. It does not describe the error. The description is printed earlier in the output, in the first line that contains the word error. Everything after it can be a result of that one problem, because the compiler tries to continue and may complain about code that depends on the broken line.
Syntax errors are often reported on the line after the real mistake. A missing semicolon is only noticed when the next token starts, so the message points at the next line.
How to confirm the cause
- Turn on verbose output in the preferences for compilation, then scroll to the first line with error in it.
- Read the file name and line number, then look at that line and the one above.
- Note the type of message: ‘expected ;’ means punctuation, ‘was not declared’ means a missing variable or include, ‘No such file’ means a library.
- Compile an empty or example sketch for the same board. If that works, the board and installation are fine and the problem is your code.
- Count the brackets and braces; an editor that highlights matching pairs helps.
Worked example
The error points at line 3, but the fault is on line 2.
void loop() {
int v = analogRead(A0) // missing semicolon here
Serial.println(v);
}
// compiler output (shape of the message):
// sketch.ino: In function 'void loop()':
// sketch.ino:3:3: error: expected ',' or ';' before 'Serial'
// exit status 1Common mistakes
- Reading only the last line of the console.
- Fixing the last error first, which changes nothing.
- Pasting code from a web page that carries curly quotes or odd characters.
- Having two functions with the same name in different tabs.
If this did not fix it
- Check the selected board and that its core is installed.
- Check library versions: a library may need a newer or older core.
- Check the sketch folder name; it must match the main file.
- Check for very long paths or special characters in folder names.