lewissbaker / cppcoro

A library of C++ coroutine abstractions for the coroutines TS
MIT License
3.36k stars 462 forks source link

Unable to build under MSVC preview. #186

Open nanoric opened 3 years ago

nanoric commented 3 years ago

cl version: 19.28.29617 Visual Studio version: 16.9.0 preview error:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29617\include\experimental/coroutine(37): fatal error C1189: #error:  The <experimental/coroutine> and <experimental/resumable> headers are only supported with /await and implement pre-C++20 coroutine support. Use <coroutine> for standard C++20 coroutines.

<experimental/coroutine> is not supported in preview version. consider use under msvc. maybe __has_include is a good choice to dertemin which file to include.

nanoric commented 3 years ago

It seems that VS2019 (without preview, 16.8.3 is unable to build cppcoro too for now.) I remember that older version of cppcoro has a header <cppcoro/coutines.h> that works fine with both versions.

andreasbuhr commented 3 years ago

In the fork https://github.com/andreasbuhr/cppcoro I made some modifications to make it work.

nanoric commented 3 years ago

In the fork https://github.com/andreasbuhr/cppcoro I made some modifications to make it work.

Thanks for responding so quickly, help me so much!