The arduino.h not found error means the core Arduino files aren’t installed, selected, or visible to your compiler.
What Arduino.h Actually Does
When you build a sketch, the compiler needs a header called Arduino.h. That header pulls in the functions and types that make Arduino code feel simple: things like pinMode, digitalWrite, millis, and the basic hardware definitions for your board. Without it, your sketch is just plain C or C++, and the compiler has no idea what those Arduino helpers mean.
In a normal sketch created inside the Arduino IDE, you usually do not see an #include line at the top. The build system adds that line for you behind the scenes. That is why many people hit an error only when they move code into a new editor or change the project structure. The message often looks like this:
fatal error: Arduino.h: No such file or directory
That message does not always mean the file truly vanished from your drive. In many cases the compiler cannot see the right core folder because the board package is missing, the wrong board is selected, or the project was created as a raw C++ project instead of an Arduino sketch. The rest of this article walks through the most common arduino.h not found cases and how to clear them.
Common Causes Of Arduino.h Not Found In Arduino IDE
Inside the official Arduino IDE, the error usually points to a setup issue rather than a damaged install. A few repeat patterns show up over and over: the wrong board core, a corrupt install, a sketch that lives in a strange folder, or case sensitivity on Linux. Understanding which pattern fits your situation saves a lot of guesswork.
Use this table as a quick reference while you test fixes:
| Symptom | Likely Cause | Quick Fix |
|---|---|---|
| Arduino.h not found only for one board | Board core not installed or broken | Reinstall that board package in Boards Manager |
| Error appears after moving project to a new folder | Sketch not in a standard sketch folder | Use “Save As” into a clean sketch folder |
| Works on Windows, fails on Linux or macOS | Wrong letter case in include line | Use #include with matching case |
Custom C++ file fails, .ino builds fine |
Manual file skips the include | Add #include to that .cpp file |
| Fresh install, nothing will compile | Core folders damaged or incomplete | Remove and reinstall the IDE and cores |
Fixing arduino.h not found On Windows, Mac, And Linux
Start with the Arduino IDE itself, because many arduino.h not found problems come from a simple settings issue. These steps apply to Arduino IDE 1.x and 2.x, with only small menu differences. The basics stay the same across Windows, macOS, and Linux.
Check Your Board And Core
- Select the right board — Open the Tools > Board menu and pick the exact board you are using, such as “Arduino Uno” or “Arduino Nano Every.” A wrong choice can point the build to a missing core.
- Open Boards Manager — In the IDE, open Tools > Board > Boards Manager. Search for the family you use, such as “Arduino AVR Boards” or “Arduino SAMD Boards.”
- Install or reinstall the core — If your family is not installed, click Install. If it is installed already and errors keep showing, click the drop-down, remove the core, then install it again.
- Try a known example — Load File > Examples > 01.Basics > Blink and hit Verify. If Blink builds, your core and board choice are fine and the trouble sits inside your sketch.
Fix Sketch And File Layout Problems
Use a clean sketch folder — Arduino sketches work best when the main .ino file lives in a folder with the same name. If you dragged files in from another project, use File > Save As to create a new sketch and move only the files you need into that folder.
- Check extra
.cppfiles — Any custom.cppor.cfile that calls Arduino functions must start with#include. The IDE does not insert that line into those files. - Watch file name case — On Linux and macOS the file system cares about upper and lower case. Make sure your include line uses
Arduino.h, notarduino.horARDUINO.H. - Avoid odd characters in paths — Place sketches in folders with simple names. Avoid long paths filled with symbols, network drives, or synced folders that might interfere with the compiler’s include paths.
- Turn on verbose output — In File > Preferences, enable verbose output during compilation. The log shows the include paths the compiler uses, which helps you see whether core folders are present.
If the official IDE still throws Arduino.h Not Found after these checks, remove it from your system, delete the Arduino15 (or .arduinoIDE) settings folder if present, then reinstall the latest stable release. A fresh setup often clears out broken paths or failed core downloads that the repair steps above cannot fix alone.
When Arduino.h Not Found Happens In Vs Code Or Platformio
In editors such as VS Code with PlatformIO or the Arduino extension, the error often appears because the project was created as a plain C++ folder. In that case the compiler toolchain has no reason to add Arduino core folders, so it truly cannot see Arduino.h until you connect the project to an Arduino-based platform.
Check PlatformIO Project Settings
- Open
platformio.ini— In the root of your project, open theplatformio.inifile and look for a line likeframework = arduino. Without that line, PlatformIO will not pull in the Arduino core. - Confirm board and platform — Check that
platformandboardmatch your hardware, such asplatform = atmelavrandboard = uno. A wrong pair leads to missing or wrong cores. - Run a clean rebuild — Use the PlatformIO: Clean and then PlatformIO: Build commands. This clears stale build files that might still raise an old error.
- Test with an example — Use the PlatformIO project wizard to create a fresh Arduino project for your board, then build it. If that works, your toolchain is fine and your custom project needs setting tweaks.
Fix Vs Code IntelliSense Only Errors
Sometimes VS Code underlines Arduino.h in red, yet the project builds and uploads without trouble. In that case the compiler can see the header, but IntelliSense cannot. That is a configuration issue inside the editor, not a real build failure.
- Use the Arduino extension project type — When you create a new project, pick the Arduino template instead of a raw C++ folder so the extension adds include paths for you.
- Trigger configuration refresh — In VS Code, run the command to rebuild IntelliSense configuration (for example, “C/C++: Reset IntelliSense database” if you use the Microsoft C/C++ extension).
- Check include paths in
c_cpp_properties.json— Make sure paths that point to your Arduino core and libraries appear there. You can copy them from the build log if needed.
Preventing Future Arduino.h Not Found Errors
Once you fix the immediate problem, a few habits make sure you rarely see Arduino.h Not Found again. Most of them are simple choices about how you start projects and where you save files.
- Start from working examples — Use built-in examples for your board as the base for new sketches. They already carry the right structure, so it is harder to break the build system.
- Keep one IDE per project — Try not to mix multiple tools on the same folder. Pick the Arduino IDE, PlatformIO, or another tool for a given project and stick to that choice for the life of that sketch.
- Update cores regularly — From time to time, open Boards Manager and update your board packages. Old cores can conflict with a new IDE release and lead to strange include issues.
- Use version control — A simple Git repo lets you roll back to a known good state if a settings change breaks your build.
- Document custom paths — If you change library folders or core locations, keep short notes in a
README.mdinside the project so you and others can recover that setup later.
When The Error Still Won’t Go Away
Now and then the arduino.h not found message hides a deeper problem, such as a broken toolchain or a custom Makefile that never points at the Arduino core. In that kind of setup you control the compile and link flags yourself, so you must add include paths and libraries by hand. The exact steps depend on the build system you picked.
If you are using the Arduino CLI, run arduino-cli core list to confirm the core for your board is present, then use arduino-cli compile for that sketch and board. A successful compile from the CLI proves the core is fine. From there, match the include paths and flags from the verbose CLI output inside your own Makefile or build script. Once those paths line up, the Arduino.h Not Found error should disappear and your sketch should compile cleanly across tools.
