【问题标题】:Visual Studio 2017: namespace "System" has no member "Windows"Visual Studio 2017:命名空间“系统”没有成员“Windows”
【发布时间】:2017-08-07 15:25:43
【问题描述】:

我最近为 Visual C++ 安装了 CLR 包,并且正在制作我的第一个 GUI。由于某种原因,系统没有显示它过去的所有选项。 System::* 之后的所有内容下都有红线,有类似的错误。这是我的头文件的开始。

#pragma once


namespace Form1 {
using namespace System;
using namespace System::Windows;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

在寻找解决方案时,我找到了this thread,并按照步骤操作

将公共语言运行时支持设置为“公共语言运行时 支持 (/clr)" 在您的项目属性中的 2 个位置: 配置属性 -> 常规 配置属性 -> C/C++ -> 常规

但这已经是默认设置了。有什么建议吗?

【问题讨论】:

  • 这样的东西有什么要包含的标题吗?

标签: c++ visual-studio visual-studio-2017


【解决方案1】:

尝试通过以下方式添加这些引用:

转到Project > References > Common Properties > Framework and References

点击Add New References...按钮

Assemblies -> Frameworks 下勾选System."Your needs" 并点击确定。

【讨论】:

    猜你喜欢
    • 2018-04-24
    • 1970-01-01
    • 2018-11-13
    • 2017-08-31
    • 1970-01-01
    • 1970-01-01
    • 2020-11-30
    • 1970-01-01
    相关资源
    最近更新 更多