fatal error: boost/xxx.hpp: No such file or directory
The compiler cannot find a Boost header, so Boost is not installed or not on the include path.
boost/ No such file or directoryfatal error: boost/Boost headers not found Meaning
Boost is a large library set that is not part of the compiler. Most of it is header-only, but it must be installed (package manager, vcpkg, or built from source) and the include path must point to it.
Common causes
- Boost development package not installed
- Boost installed in a custom folder not passed with
-I - Wrong version in CMake
find_package(Boost ...) - Homebrew on Apple silicon uses
/opt/homebrew/include
⚡ Quick fix
- Install Boost (
libboost-all-dev,brew install boost,vcpkg install boost) - Pass
-I/path/to/boostor setBOOST_ROOT - Use CMake
find_package(Boost REQUIRED)
Detailed fix by platform
Ubuntu
sudo apt install libboost-all-dev
macOS
brew install boostthen-I$(brew --prefix)/include
CMake
find_package(Boost 1.74 REQUIRED COMPONENTS system filesystem)andtarget_link_libraries(app Boost::system Boost::filesystem)
How to diagnose
- Installed — Is boost/ in an include dir?
- Path — Does the compiler see it?
- Version — Required version present?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- C1083 MSVC: fatal error C1083: Cannot open include file: 'foo.h': No such file or directory
- call of overloaded is ambiguous C++: error: call of overloaded 'f(int)' is ambiguous
- cannot declare variable to be of abstract type C++: error: cannot declare variable 'x' to be of abstract type 'Shape' (pure virtual functions)
Most viewed in C/C++
- Bus error C/C++: Bus error (core dumped) — SIGBUS from misaligned access or a bad memory-mapped file
- AddressSanitizer: heap-buffer-overflow C/C++: ==ERROR: AddressSanitizer: heap-buffer-overflow on address — READ/WRITE of size N
- AddressSanitizer: heap-use-after-free C/C++: ==ERROR: AddressSanitizer: heap-use-after-free on address — memory used after delete/free
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 2 Dec 2026