boost/ header C/C++ Origin: Application & API OSI layer 7 · Application Last updated 2 Dec 2026

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.

Exact message you may see boost/ No such file or directoryfatal error: boost/Boost headers not found
Seen on: C/C++ Linux macOS

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

  1. Install Boost (libboost-all-dev, brew install boost, vcpkg install boost)
  2. Pass -I/path/to/boost or set BOOST_ROOT
  3. Use CMake find_package(Boost REQUIRED)

Detailed fix by platform

Ubuntu

  1. sudo apt install libboost-all-dev

macOS

  1. brew install boost then -I$(brew --prefix)/include

CMake

  1. find_package(Boost 1.74 REQUIRED COMPONENTS system filesystem) and target_link_libraries(app Boost::system Boost::filesystem)

How to diagnose

  1. Installed — Is boost/ in an include dir?
  2. Path — Does the compiler see it?
  3. 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:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

C1083 — MSVC: fatal error C1083: Cannot open include file: 'foo.h': No such file or directory (C/C++)C1083call of overloaded is ambiguous — C++: error: call of overloaded 'f(int)' is ambiguous (C/C++)call of overloaded is…cannot declare variable to be of abstract type — C++: error: cannot declare variable 'x' to be of abstract type 'Shape' (pure virtual functions) (C/C++)cannot declare variab…circular include — error: field has incomplete type / invalid use of incomplete type caused by two headers including each other (C/C++)circular includeCould not find a package configuration file — CMake Error: Could not find a package configuration file provided by "Foo" (requested version 1.2) (C/C++)Could not find a pack…fatal error: No such file or directory — C/C++: fatal error: foo.h: No such file or directory — #include not found (C/C++)fatal error: No such …reference to is ambiguous — C++: error: reference to 'X' is ambiguous (using namespace std conflicts) (C/C++)reference to is ambig…undefined reference to boost — undefined reference to `boost::system::...' / `boost::filesystem::...' / `boost::thread::...' (C/C++)undefined reference t…boost/ he…

Explore the map of this error Full error map →

🧠 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.