Source: https://mokxi.com/errors/esp-camera-h-no-such-file-or-directory
Updated: 2026-11-16

Home / Errors
Arduino build error

# fatal error: esp_camera.h: No such file or directory

esp_camera.h is the camera driver of the ESP32 board package. It exists for ESP32 boards, such as the ESP32-CAM, and for nothing else.

Try the fixed sketch in Mokxi See the causes

- Build error
- 2 common causes

The message

## What the Arduino IDE prints

Output window

On an Uno, an ESP8266 or a missing board package, the file is not there.

Mokxi's compiler, clang, words it as 'esp_camera.h' file not found.

Causes

## The 2 usual causes with the fix

### 1The board is not an ESP32

Choose an ESP32 board. For the AI Thinker ESP32-CAM, pick that board by name. Mokxi draws the camera but does not simulate an image: esp_camera_init() fails with ESP_ERR_NOT_FOUND, so your own failure path runs.

Broken

Fixed

Mokxi’s build tab says: Pick an ESP32 board

Try this fix in Mokxi

### 2The ESP32 board package is not installed

The camera driver comes with the ESP32 package, not with the Arduino IDE. Install it once.

- In the Arduino IDE, open File, Preferences, and add the ESP32 package URL under Additional boards manager URLs.
- Open Tools, Board, Boards Manager, search for esp32, and install the one by Espressif Systems.
- Pick your ESP32 board under Tools, Board, then compile again.

FAQ

## Questions and answers

### Does the camera work in Mokxi?

The camera is drawn, but nothing simulates an image. esp_camera_init() reports that no camera answered, so you can test the rest of the sketch.

### Which boards have esp_camera.h?

ESP32 boards with a camera port, such as the AI Thinker ESP32-CAM and the ESP32-S3 camera boards.

### Why does the ESP32-CAM need a special board setting?

The camera pins differ between boards. Pick the board that matches yours, or set the pins in camera_config_t.

Next

## More errors and the longer guide

- fatal error: WiFi.h: No such file or directory
- fatal error: Servo.h: No such file or directory

The longer guide to this error All Arduino errors
