Vscode使用教程

1.安装编译器

https://sourceforge.net/projects/mingw-w64/
下载x86_64-win32-seh
解压缩放到非中文路径下,然后并把mingw64\bin添加到系统环境变量Path中

2.task.json

终端 -> 配置默认生成任务 -> C/C++: g++.exe 生成活动文件

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cppbuild",
            "label": "build",
            "command": "D:\\software\\mingw64\\bin\\g++.exe",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "test.cpp",
                "-o",
                "test.out"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "编译器: D:\\software\\mingw64\\bin\\g++.exe"
        }
    ]
}

3.launch.json

运行 -> 添加配置 -> (gdb) 启动
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
“version”: “0.2.0”,
“configurations”: [

    {
        "name": "(gdb) 启动",
        "type": "cppdbg",
        "request": "launch",
        "program": "${fileDirname}//test.out",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${fileDirname}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "gdb",
        "preLaunchTask":"build"
    }
]

}

4.插件

Resource Monitor, 监控内存,磁盘信息
GitLens

相关推荐

  1. VSCode使用教程

    2024-04-10 06:08:09       54 阅读
  2. Vscode使用教程

    2024-04-10 06:08:09       36 阅读
  3. VSCode+Anaconda+Python使用教程

    2024-04-10 06:08:09       36 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-10 06:08:09       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-10 06:08:09       106 阅读
  3. 在Django里面运行非项目文件

    2024-04-10 06:08:09       87 阅读
  4. Python语言-面向对象

    2024-04-10 06:08:09       96 阅读

热门阅读

  1. 【hive】单节点搭建hadoop和hive

    2024-04-10 06:08:09       32 阅读
  2. Hadoop 源码中使用ServiceLoader

    2024-04-10 06:08:09       39 阅读
  3. vscode 关键字记录

    2024-04-10 06:08:09       31 阅读
  4. Ajax、Fetch、Axios三者的区别

    2024-04-10 06:08:09       42 阅读
  5. 在 Vue 3 中使用 Axios 发送 POST 请求

    2024-04-10 06:08:09       37 阅读
  6. BERT的训练过程解析:从数据准备到fine-tuning

    2024-04-10 06:08:09       38 阅读
  7. WPF —— 动画缩放变换

    2024-04-10 06:08:09       40 阅读