首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >库包括WinRT brocken

库包括WinRT brocken
EN

Stack Overflow用户
提问于 2021-06-26 03:02:49
回答 1查看 1.4K关注 0票数 2

我正在尝试编译这个项目:https://github.com/bucienator/ble-win-cpp

克隆存储库后,我得到错误"wait_for“不是"winrt ::impl”的成员。使用NuGet,我将Microsoft.Windows.CppWinRT包添加到项目中。但在那之后,我对所有图书馆的导入都中断了:

代码语言:javascript
复制
#include <winrt / Windows.Foundation.h>
#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>

告诉我如何让Visual编译我的项目?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-06-26 08:12:56

不确定它以前是如何编译的,但它已经有3年的历史了,所以它有可能是用一个旧的C++/WinRT编译的。

这里提到了"wait_for“问题:https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/issues/47和我的解决方案是添加Microsoft.Windows.CppWinRT包。

然后,您将遇到其他问题,您必须像这样修复pch.h:

代码语言:javascript
复制
...
#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>
...    
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68138854

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档