Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

Fix “exit status 1” / “Compilation error: exit status 1”

“exit status 1” only says the compiler failed. The real error is higher up in the output — here’s how to find and read it.

All boardsUpdated 31 Oct 2026

Community draft — report a mistake

What you see

OutputOutput
sketch.ino: In function 'void setup()':
sketch.ino:8:3: error: expected ';' before 'pinMode'
    8 |   pinMode(2, OUTPUT);
      |   ^~~~~~~
exit status 1

Compilation error: exit status 1

“exit status 1” is the last line of a failed compile, not the error itself. The useful message is always above it, with a file name, line number and a short description.

Quick fix — try in order

  1. 1

    Scroll up to the first “error:” line

    Enable File → Preferences → “Show verbose output during compile” only if needed; usually the first red “error:” line above “exit status 1” is the real problem.

  2. 2

    Fix the first error first

    One mistake (a missing ; or }) can cause dozens of follow-on errors. Fix the first, compile again.

  3. 3

    Check the line before the reported one

    “expected ';' before X” usually means the semicolon is missing at the end of the previous line.

  4. 4

Why it happens

What is exit status 1?

It is the compiler program’s return code meaning “failed”. It contains no detail on its own.

Missing semicolon or brace

The most common cause for beginners. Every statement ends with ; and every { needs a matching }.

Wrong board selected

Code written for ESP32 fails on an Uno board setting (and vice versa) with many errors.

↑↓ to move · Enter to open