“wait_for“: 不是 “winrt::impl“ 的成员

2 篇文章 0 订阅

错误    C2039    "wait_for": 不是 "winrt::impl" 的成员     C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\cppwinrt\winrt\impl\Windows.Foundation.0.h    983    
 

vs2019 编译 winrt,报错,"wait_for" is not member of "winrt::impl",错误的中文描述是"wait_for": 不是 "winrt::impl" 的成员

windows sdk 版本 10.0.19041.0

解决办法:

方法 一:

把符合模式改为 否 (/permissive),然后重新编译,就不会有winrt::imp的报错了

工程文件xxxx.vcxproj中的字段是 <ConformanceMode>true</ConformanceMode>

为啥呢?请搜索,符合模式premissive,了解一下这个字段的含义

 参考:

https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/issues/47

 

方法二:

windows sdk中winrt相关的文件旧了,不符合premissive的安全检查了,需要用新的CppWinRT

vs2019工具中Nuget包管理中,搜索 Microsoft.Windows.CppWinRT,下载安装就行

https://github.com/adabru/BleWinrtDll/issues/16

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值