g++ - VS2022 i"mport std.core" 编译需要安装什么
问题描述
当我使用以下内容时,
import std.core;
我得到错误,
Error C1011 cannot locate standard module interface. Did you install the library part of the C++ modules feature in VS setup?
我检查了安装,但找不到如何安装 C++ 模块功能。我还担心这不够标准,无法在 gcc 11.2.0 和 VS2022 上编译。
解决方案
- 打开 Visual Studio 安装程序并确保已安装用于 v143 构建工具(x64/x86 - 实验性)的 C++ 模块。
- 打开您的项目,转到Properties -> C/C++ -> Languages -> Enable Experimental C++ Standard Library Modules并将其设置为Yes (/experimental:module))
它仍然是一个实验性功能,因此在导入标准模块时您可能会收到一些 C5050 警告。有关更多信息,您可以访问https://docs.microsoft.com/en-us/cpp/cpp/modules-cpp?view=msvc-170
推荐阅读
- css - CSS 变量 - 交换值?
- sorting - 在 ElasticSearch 中对动态字段进行搜索和排序
- android - 将字节数组图像传递到下一个活动
- ruby-on-rails - Rails & Cells:在视图内渲染数组
- oracle - Oracle 查询以列方式显示“ORACLE”
- php - 数据库 [dpnmwin] 未配置
- jquery - 使用 jquery 添加类没有任何效果
- ios - NSFileManager ubiquityIdentityToken 应用程序意外崩溃 (EXC_BAD_ACCESS)
- c++ - 优先级队列中用户对象的比较运算符
- node.js - 尝试运行节点服务器时出现未处理的错误