c++ - ubuntu 20.04 上的 Visual Studio 代码。c++ 语法检查器无法正常工作
问题描述
我正在尝试在 Ubuntu 20.04 上使用 Visual Studio Code 学习 c++17,其中包含以下内容tasks.json
{
"tasks": [
{
"type": "shell",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-std=c++2a",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
],
"version": "2.0.0"
}
我有以下代码,它编译和运行良好。
#include <iostream>
#include <set>
using namespace std;
int main() {
set<int> mSet;
auto [iter, inserted] = mSet.insert(10);
return 0;
}
我认为我的代码没有任何问题,那么如何使 Visual Studio Code 语法检查器正常工作?
解决方案
推荐阅读
- node.js - React 在 HTTPS 时拦截 /auth/twitter/。我想从我的节点服务器而不是反应应用程序访问 /auth/twitter/
- c - 我正在尝试插值并找到 C 中插值的最小 x (可能使用割线法)
- android - 如何将公式的结果发送到 android 中的音频流?
- jquery - 无法运行 datetimepicker
- python - ValueError:时间数据 'LEGACY SYSTEM' 与格式 '%H:%M:%S' 不匹配
- ml.net - ML.Net 转换是否应用停用词?
- node.js - 是否有用于 npm 审计的 TypeScript 类型?
- r - R中的正则表达式(重复运算符的无效使用)表达式在转义后不起作用
- javascript - 试图让我的社交链接在悬停在它们上方时保持静止
- firebase - 来自 Cloud Functions 的 Firebase ML Kit 自定义模型推断