See the question and my original answer on StackOverflow

Not sure how this used to compile but it's 3 years old so it's possible it compiled with an older C++/WinRT.

The "wait_for" issue is mentioned here: https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/issues/47 and my solution is to add the Microsoft.Windows.CppWinRT package.

Then you will have other issues and you have to fix the pch.h like this:

...
#include <iostream>
#include <sstream>
#include <iomanip>
#include <mutex> // add this
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h> // add this
#include <winrt/Windows.Devices.Bluetooth.h>
#include <winrt/Windows.Devices.Enumeration.h>
#include <winrt/Windows.Devices.Bluetooth.Advertisement.h>
#include <winrt/Windows.Devices.Bluetooth.GenericAttributeProfile.h>
#include <winrt/Windows.Storage.Streams.h>
...