samedi 10 avril 2021

error C2039: 'async': is not a member of 'std'

I'm trying to create a strategy game using C++ and SDL2. I want to make it so that when a variable bGameIsPaused of type Boolean is false, the game increments the variable day of type integer by one every 2 seconds. I did some digging and I found out that I could probably implement this feature using std::async. In [the project's properties

enter image description here I have set the c++ standard as /std:c++latest which means that in theory I should have access to all the features that are included in the ISO c++ 11 standard, but when I am trying to use the async member of std, I get the following error

1>N:\VS repositories\The_Great_War\PlayerController.cpp(78,8): error C2039: 'async': is not a member of 'std' 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\string(24): message : see declaration of 'std' 1>N:\VS repositories\The_Great_War\PlayerController.cpp(78,13): error C2065: 'async': undeclared identifier

Aucun commentaire:

Enregistrer un commentaire