make "*** [target] Error 1" recipe failed in CI
A command inside a make recipe returned a non-zero exit code, and make reports it as "Error <code>". "Error 1" is the failing command's exit status, not a make bug; the real cause printed just above.
What this error means
make stops with "make: *** [Makefile:20: app] Error 1" after a compiler, linker, or shell command in the recipe failed.
make
g++ -c main.cpp -o main.o
main.cpp:5:10: fatal error: config.h: No such file or directory
make: *** [Makefile:20: main.o] Error 1Common causes
A recipe command failed
The compiler, linker, or a shell step in the recipe exited non-zero; make surfaces that exit code.
A missing tool or input in the recipe
A command in the recipe references a tool or file absent on the runner, so it exits with an error.
How to fix it
Read the command output above the Error line
- Find the last command make ran before "Error 1".
- Read its actual error message (a compile error, missing header, or missing tool).
- Fix that command's cause, then re-run make.
Keep going to collect all failures
Use -k to see every failing recipe in one run instead of stopping at the first.
Terminal
make -kHow to prevent it
- Treat "Error 1" as the exit code of the real failing command above it.
- Install all tools the recipes invoke in a setup step.
- Fail fast in recipes so the first real error is obvious.
Related guides
make "No rule to make target" in CIFix make "*** No rule to make target X, needed by Y. Stop." in CI - a prerequisite file is missing and the Ma…
Ninja "build stopped: subcommand failed" in CIFix Ninja "build stopped: subcommand failed" in CI - a compile or link command exited non-zero. The real erro…
CMake build "fatal error: X.h: No such file or directory" in CIFix "fatal error: X.h: No such file or directory" during a CMake build in CI - the compiler cannot find a hea…