How to fix "'system_clock': is not a member of 'std::chrono'"

Saperlipopette 0 Reputation points
2025-03-21T16:52:43.88+00:00

I made the mistake of letting Microsoft install some extensions to Visual Studio Code, and now I get the following error when building my project when using Visual Studio Professional 2022, Version 17.13.3:

‘system_clock’: is not a member of ‘std::chrono’

The VS error code is C2039.

Any idea on how to fix this? I’m assuming that I’m not using a compatible version of VS or C/C++ (I’m using Visual C++ 2022 00476-80000-00000-AA063)

Developer technologies C++
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 122.5K Reputation points
    2025-03-21T17:00:44.5866667+00:00

    Make sure that source or header files contain #include <chrono>.

    Show details if this does not help.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.