You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CppWinRT无法为Microsoft.AI.MachineLearning NuGet包生成头文件

问题:无法找到Microsoft.AI.MachineLearning.h头文件

我正在完成微软的port-to-nuget教程。注意:cppwinrt提供Windows.AI.MachineLearning命名空间,而另一个NuGet包提供Microsoft.AI.MachineLearning命名空间。

按照理论,C++/WinRT工具包应当识别Microsoft.AI.MachineLearning NuGet包,并在Generated Files\winrt文件夹中生成对应的头文件。

但我创建新控制台应用,添加CppWinRT和Microsoft.AI.MachineLearning NuGet包并编写代码后,仍出现如下错误:

fatal error C1083: Cannot open include file: 'winrt/Microsoft.AI.MachineLearning.h': No such file or directory

参考Stack Overflow上的同类问题也无法解决该问题。

内容的提问来源于stack exchange,提问作者Tom Huntington

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.01 17:01:15