Ad Space — Top Banner

exit status 1 — Compilation error

Arduino Microcontroller Board

Severity: Minor

What Does This Error Mean?

Exit status 1 means your Arduino sketch has a code error that prevents it from compiling. The actual error is in the orange/red text above the exit status message. Scroll up in the output window to find the specific error and line number.

Affected Models

  • Arduino Uno
  • Arduino Nano
  • Arduino Mega 2560
  • Arduino Leonardo
  • Arduino ESP32
  • All Arduino-compatible boards

Common Causes

  • Missing semicolon at the end of a line
  • Mismatched curly braces { }
  • Undeclared variable or function name (typo)
  • Missing #include for a library
  • Library not installed or incompatible version

How to Fix It

  1. Scroll up in the output window to find the actual error message.

    The exit status 1 line is just the summary. The real error is above it. Look for lines containing error: followed by a description and line number.

  2. Check for missing semicolons.

    Every statement in Arduino (C++) must end with a semicolon. int x = 5 is wrong. int x = 5; is correct. The error often points to the line AFTER the missing semicolon.

  3. Check for mismatched braces.

    Every { must have a matching }. The Arduino IDE highlights matching braces when you click on one. Missing braces cause confusing errors that point to the wrong line.

  4. Install missing libraries: Sketch > Include Library > Manage Libraries.

    If the error says No such file or directory for a .h file, the library is not installed. Search for it in the Library Manager and install it.

Frequently Asked Questions

Why does the error point to the wrong line?

The compiler reads your code top to bottom. A missing semicolon on line 10 may not cause a problem until the compiler reaches line 11. Always check the line BEFORE the reported line number too.

What does was not declared in this scope mean?

It means you used a variable or function name that the compiler does not recognise. Either you have a typo, forgot to declare the variable, or forgot to #include the library that defines it.