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

error: 'format' is not a member of 'std' (<format> not found)

The standard library in use does not have C++20 std::format.

Exact message you may see 'format' is not a member of 'std'<format> file not foundstd::format not foundno member named 'format' in namespace 'std'
Seen on: C++ GCC Clang

Meaning

<format> arrived in GCC 13, MSVC 2019 16.10 and libc++ 17/18 (partial before). Older toolchains, even with -std=c++20, do not ship it.

Common causes

  • GCC older than 13
  • Apple Clang with an old libc++
  • Missing #include <format>
  • Standard set below C++20

⚡ Quick fix

  1. Upgrade the compiler/standard library
  2. Use the {fmt} library (fmt::format) as a drop-in
  3. Include <format> and compile with -std=c++20

Detailed fix by platform

CMake

  1. find_package(fmt REQUIRED) and target_link_libraries(app fmt::fmt)

How to diagnose

  1. Compiler — GCC 13 or newer?
  2. Std — c++20?
  3. Header — <format>?

🔧 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):

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…coroutine — error: 'co_await' / 'co_return' requires the compiler to be run with -fcoroutines (or <coroutine> not found) (C/C++)coroutinenot a member of std — C++: error: 'optional' in namespace 'std' does not name a template type — wrong -std standard (C/C++)not a member of stdonly available with — C++: warning: structured bindings / inline variables only available with '-std=c++17' or '-std=gnu++17' (C/C++)only available withreference to is ambiguous — C++: error: reference to 'X' is ambiguous (using namespace std conflicts) (C/C++)reference to is ambig…unrecognized command-line option — g++: error: unrecognized command-line option '-std=c++20' (C/C++)unrecognized command-…Wformat-security — warning: format string is not a string literal (potentially insecure) [-Wformat-security] (C/C++)Wformat-securitystd::form…

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.