简体   繁体   English

如何添加对 Windows 通用 C++ 项目的引用

[英]How do I add a reference to a Windows Universal C++ project

I am new on windows universal apps and Visual Studio 2015 projects and I can't find how to add a reference to the C++ project.我是 Windows 通用应用程序和 Visual Studio 2015 项目的新手,我找不到如何添加对 C++ 项目的引用。 I want to use LINQ and the namespace System.Linq can't be found.我想使用 LINQ,但找不到命名空间 System.Linq。

I can't find how to add a reference to the C++ project.我找不到如何添加对 C++ 项目的引用。 I want to use LINQ and the namespace System.Linq can't be found.我想使用 LINQ,但找不到命名空间 System.Linq。

You cannot reference a .NET assembly LINQ to a UWP C++ project.不能将 .NET 程序集 LINQ 引用到 UWP C++ 项目。 You can only reference the UWP Windows Runtime Component to it.您只能将 UWP Windows 运行时组件引用到它。

Right-click on "References" in the solution explorer, and click "Add reference" in the pop-up menu.右键单击解决方案资源管理器中的“引用”,然后在弹出菜单中单击“添加引用”。 That will open the reference manager where you can select the reference you need.这将打开参考管理器,您可以在其中选择所需的参考。 You can read more about the topic in this MSDN article .您可以在这篇 MSDN 文章中阅读有关该主题的更多信息。

[ [ 在此处输入图片说明 ] 2 ] 2

You No need to add additional reference to 'System.Linq' by default it is there.默认情况下,您无需添加对“System.Linq”的额外引用,它就在那里。 just add using System.Linq;只需using System.Linq;添加using System.Linq;

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何添加对C#项目调用的非托管C ++项目的引用? - How do I add a reference to an unmanaged C++ project called by a C# project? 如何在 Visual Studio 中添加 C++ 项目引用? - How do you add a C++ project reference in Visual Studio? 在ac#项目中使用OpenCV的C ++项目参考(Windows Universal)vs2015 - reference c++ project using OpenCV in a c# project (windows universal) vs2015 如何使用Visual Studio在.Net C ++项目上添加DLL作为参考 - How do I add a DLL as a reference on .Net C++ Project using Visual Studio 将通用Windows C#类库引用添加到通用Windows C ++ DLL项目Visual Studio 2015 - Adding a Universal Windows C# Class Library reference to a Universal Windows C++ DLL project Visual Studio 2015 如何在我的 .Net Framework 项目中添加对 Windows 运行时组件 (C++/WinRT) 的引用 - How to add a reference to Windows Runtime Component (C++/WinRT) in my .Net Framework project 如何在我的C ++项目中添加计时器? - How do I add a timer to my C++ project? 如何将库添加到NetBeans C ++项目? - How do I add a library to my NetBeans C++ project? 如何使用纯C ++而不是C ++ / CLI开发通用Windows 10应用程序? - How can I develop universal windows 10 apps with pure C++ and not C++/CLI? 如何在本机应用程序中向C ++项目添加DLL引用? - How to add DLL reference to a c++ project in a native application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM