Users may encounter the following errors when compiling a C++ program with GCC 13:
error: 'uint64_t' in namespace 'std' does not name a type
or
error: 'std::uint64_t' has not been declared
These errors occur because #include <cstdint>
is missing. According to the GCC 13 Porting Guide, some C++ Standard Library headers have been modified to no longer include other headers that were previously used internally. As a result, C++ programs that rely on standard library components without explicitly including the appropriate headers will now fail to compile.
Workaround
- Add the appropriate headers (e.g.,
<cstdint>
) to your program. - Alternatively, compile your program with GCC 12 if updating the code is not feasible.
Affected versions
13.2.0 and later versions