# configure: error: C compiler cannot create executables / no acceptable C compiler found in $PATH

**Code:** `C compiler cannot create executables` · **Category:** C/C++ · **Seen on:** Linux, Make

The autoconf check could not build a test program.

## Meaning

The configure script compiles and runs a trivial C program. If that fails it aborts. The real reason — missing compiler, missing libc headers, bad `CFLAGS`, or a cross-compiler without sysroot — is recorded at the end of `config.log`.

## Common causes

- No compiler
- Missing build-essential
- Broken CFLAGS
- Wrong `CFLAGS` or `LDFLAGS` exported in the shell
- Cross-compiling without --host

## Quick fix

1. Install build tools
2. Read `config.log`
3. Open `config.log` and read the last compiler error
4. Unset stray `CFLAGS` and retry

## Detailed fix by platform

### Ubuntu

1. `sudo apt install build-essential`

## How to diagnose

1. **Log** — config.log?
2. **Recent change** — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/cpp/configure-c-compiler-cannot-create-executables)
