Closed mimi89999 closed 1 year ago
You may be using an older or untested version. The CI build validates a few scenarios with different compilers. It may help narrow down what might be wrong:
https://github.com/microsoft/cppwinrt/actions/runs/4325498719/jobs/7551737827
It seems you are using experimental coroutines (as shown by the path to the coroutines header in the error). Experimental coroutines where only ever supported with MSVC, and unless you manually defined _RESUMABLE_FUNCTIONS_SUPPORTED
, I don't think cppwinrt even attempts to use experimental coroutines on Clang.
You should be able to use C++20 coroutines however.
You need to pass -std=c++20
(or -std=gnu++20
) to clang++ to enable C++20.
The error is just confusing. LLVM's libc++ does have experimental/coroutine
but that implementation is different from the one from the MSVC STL so it's really untested, and I don't think it's worth the trouble to try to make it compatible. There should probably be a && defined(_MSC_VER)
here: https://github.com/microsoft/cppwinrt/blob/629f9e7659a7dae408606456cf8a9f05ff2f4511/strings/base_includes.h#L58
Hypothetically, if the user doesn't need to use coroutine at all, is it possible to make cppwinrt usable in C++17 without coroutine support?
Hypothetically, if the user doesn't need to use coroutine at all, is it possible to make cppwinrt usable in C++17 without coroutine support?
It used to be possible, I don't remember when that changed exactly.
Thanks. I switched to C++20 and it build!
Version
v2.0.230225.1
Summary
MSYS2 Clang build fails with:
Reproducible example
No response
Expected behavior
No response
Actual behavior
No response
Additional comments
No response