Closed equeim closed 1 year ago
Pass /await:strict to the compiler to enable the C++20 coroutines ABI in C++17
That would mean using overlay triplets with vcpkg and I would rather avoid it unless it is absolutely necessary. I guess I can "fix" this with _ALLOW_COROUTINE_ABI_MISMATCH although it does sound dangerous.
You can also do the reverse and pass /await
to use the C++17 coroutines ABI in C++20 I think.
C++/WinRT adopted coroutines very early on, but as @sylveon points out you can compile it today with C++20 and avoid the older headers.
Version
v2.0.220110.5
Summary
My application is compiled with
/std:c++20
. It links to a library that is compiled with/std:c++17
. Both the library and the application include<winrt/base.h>
which includes either<experimental/coroutine>
or<coroutine>
depending on/std
switch. Neither library nor application actually use coroutines but it still causes linker errors. Is there any way I can prevent winrt from including coroutine header so that it doesn't cause this conflict? (BTW it's kind of a dick move from a library to use experimental stuff which is not ABI stable, and do so by default).Reproducible example
Expected behavior
No linker errors.
Actual behavior
error LNK2038: mismatch detected for '_COROUTINE_ABI': value '1' doesn't match value '2'
Additional comments
No response