Arduino “exit status 1: Error compiling for board”: how to find the real error

This message is only the summary. The real error is the first red line above it. Scroll up in the output pane and read that line.

What the message means

“exit status 1” means the compiler stopped with an error. It does not say why. The cause is printed earlier in the output, and the board message at the end is added by the IDE.

Fix it in this order

  1. Scroll to the first error line in the output. Fix that one, then compile again; later errors often disappear.
  2. Turn on verbose output in File > Preferences (Show verbose output during compilation) for more detail.
  3. Check Tools > Board matches your board. A sketch for one chip can fail on another.
  4. If the error names a header, install the library. See the missing library page.
  5. If the error is a syntax message, see the expected semicolon page.
  6. Update or reinstall the board package or library if the error points inside it.

If you see this, do this

You seeDo this
The first error mentions a headerInstall the library.
The first error mentions a functionCheck the board and the library version.

missing library header, expected semicolon, not declared in this scope.

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.