C++ guides
Modern C++ guides: C++20 and C++23 features, compilers, build systems, and measured performance.
-
'std::variant' Is Not a Member of 'std' Fix Error Reference
A program that uses std::variant fails with ''variant' is not a member of 'std'' when the #include
line is... -
'std::span' Is Not a Member of 'std' Fix Error Reference
A C++20 program that uses std::span fails with ''span' is not a member of 'std'' when the #include line is missing...
-
'std::shared_ptr' Is Not a Member of 'std' Fix Error Reference
A C++ program that uses std::shared_ptr and std::make_shared with only
included fails with ''shared_ptr' is not a member of... -
'std::mutex' Is Not a Member of 'std' Fix Error Reference
A program that uses std::mutex fails with ''mutex' is not a member of 'std'' when the #include
line is missing... -
'std::format' Is Not a Member of 'std' Fix Error Reference
A C++20 program that uses std::format fails with the single error ''format' is not a member of 'std'' when the #include...
-
'std::expected' Is Not a Member of 'std' Fix Error Reference
A C++23 program that uses std::expected fails with ''expected' is not a member of 'std'' when the #include
... -
'std::any' Is Not a Member of 'std' Fix Error Reference
A program that uses std::any fails with ''any' is not a member of 'std'' when the #include
line is missing, and GCC... -
'std::accumulate' Is Not a Member of 'std' Fix Error Reference
A C++ program that calls std::accumulate with
, , and included fails with ''accumulate' is not... -
C++ static_assert Failed Fix Error Reference
GCC reports 'static assertion failed' when a static_assert condition is false at compile time. This guide reads the diagnostic including its note...
-
No Match for Operator== Fix Error Reference
GCC reports 'no match for operator==' when two objects of a class type are compared and the class defines no equality operator. This guide reads...
-
Marked Override Does Not Override Fix Error Reference
GCC reports 'marked override, but does not override' when a function marked override does not match any virtual function in the base class. This...
-
Cannot Bind Rvalue Reference Fix Error Reference
GCC says an rvalue reference of type 'int&&' cannot bind to an lvalue of type 'int' when a named variable is passed where a...
-
'std::vector' Is Not a Member of 'std' Fix Error Reference
A program that uses std::vector fails with ''vector' is not a member of 'std'' when the #include
line is... -
'std::unique_ptr' Is Not a Member of 'std' Fix Error Reference
A program that uses std::unique_ptr fails with ''unique_ptr' is not a member of 'std'' when the #include
line is... -
'std::thread' Is Not a Member of 'std' Fix Error Reference
A program that uses std::thread fails with ''thread' is not a member of 'std'' for two reproduced reasons: the #include...
-
'std::sort' Is Not a Member of 'std' Fix Error Reference
A program that calls std::sort fails with ''sort' is not a member of 'std'' when the #include
line is... -
'std::set' Is Not a Member of 'std' Fix Error Reference
A program that uses std::set fails with ''set' is not a member of 'std'' when the #include
line is missing —... -
'std::queue' Is Not a Member of 'std' Fix Error Reference
A program that uses std::queue fails with ''queue' is not a member of 'std'' when the #include
line is missing —... -
'std::print' Is Not a Member of 'std' Fix Error Reference
A program that calls std::print or std::println fails in one of two ways: 'fatal error: print: No such file or directory' when the standard library...
-
'std::optional' Is Not a Member of 'std' Fix Error Reference
A program that uses std::optional fails with ''optional' is not a member of 'std'' when the #include
line is... -
'std::map' Is Not a Member of 'std' Fix Error Reference
A program that uses std::map fails with ''map' is not a member of 'std'' when the #include
-
'std::function' Is Not a Member of 'std' Fix Error Reference
A program that uses std::function fails with ''function' is not a member of 'std'' when the #include
line is... -
'std::deque' Is Not a Member of 'std' Fix Error Reference
A program that uses std::deque fails with ''deque' is not a member of 'std'' when the #include
line is missing —... -
'std::array' Is Not a Member of 'std' Fix Error Reference
A program that uses std::array fails with ''array' is not a member of 'std'' when the #include
line is missing... -
Undefined Reference to Typeinfo Fix Error Reference
A link that fails with 'undefined reference to typeinfo for X' is missing the run-time type information object for a polymorphic class, not a...
-
Undefined Reference to Static Member Fix Error Reference
A link that fails with 'undefined reference to Config::limit' is missing the definition of a static data member, not its declaration. The...
-
R_X86_64_PC32 Relocation Error Fix Error Reference
The GNU linker stops a shared-object build when an object compiled without -fPIC reaches a global variable through an R_X86_64_PC32 relocation...
-
R_X86_64_32 Relocation Error Fix Error Reference
A function that returns a string literal, compiled without -fPIC, records the literal's address as an R_X86_64_32 relocation against .rodata: the GNU...
-
Pure Virtual Method Called Fix Error Reference
A base class constructor or destructor that reaches a pure virtual function through an ordinary member function compiles cleanly, then aborts at run time...
-
Jump to Label Crosses Initialization Fix Error Reference
GCC stops the build when a goto or a switch case label jumps past the initialization of a variable that is still in scope at the label: 'jump to...