CppWinRT不会为另一个NuGet包生成头文件。

huangapple go评论56阅读模式
英文:

CppWinRT wont generate headers for another nuget package

问题

我试图让这个教程工作: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 包,使用以下代码,但仍然收到以下错误

致命错误 C1083: 无法打开包括文件:'winrt/Microsoft.AI.MachineLearning.h':没有这个文件或目录

以下重复问题无法提供帮助:https://stackoverflow.com/questions/63376609/cannot-open-microsoft-ai-machinelearning-h-from-nuget-package

英文:

I'm trying to get this tutorial to work: port-to-nuget. (Note that cppwinrt provides the Windows.AI.MachineLearning namespace, but for quicker releases a different nuget package provides the Microsoft.AI.MachineLearning namespace)

Apparently the C++/WinRT toolkit is meant to pick up on the Microsoft.AI.MachineLearning NuGet package and generate the appropriate headers in the Generated Files\winrt folder.

However, I've tried creating a new console app, adding the CppWinRT and Microsoft.AI.MachineLearning nuget packages with the following code but am still getting the following error

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

The following duplicate question doesn't help: https://stackoverflow.com/questions/63376609/cannot-open-microsoft-ai-machinelearning-h-from-nuget-package

答案1

得分: 0

我安装了错误的NuGet包

Microsoft.AI.DirectML +250,000次下载,而不是Microsoft.AI.MachineLearning +38,000次下载。

英文:

I installed the wrong nuget package

Microsoft.AI.DirectML +250k downloads instead of Microsoft.AI.MachineLearning +38k downloads.

huangapple
  • 本文由 发表于 2023年2月6日 08:29:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75356448.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定