Vscode使用教程

1.安装编译器

https://sourceforge.net/projects/mingw-w64/

下载x86_64-win32-seh

解压缩放到非中文路径下,然后并把mingw64\bin添加到系统环境变量Path中

2.task.json

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

cpp 复制代码
{
    // 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

相关推荐
AM艾玛41 分钟前
Flutter 环境搭建实录
vscode·flutter
图扑软件1 小时前
其域创新 × 图扑软件|3DGS 高斯泼溅智慧钢厂实景孪生
前端·低代码·3d·编辑器·图形渲染·可视化
来自内蒙古的田园蒙牛2 小时前
WebStorm 接入 Ollama:使用 Qwen2.5-Coder 在本地运行 AI 编程助手
ide·人工智能·webstorm
Duo1J2 小时前
【UE】Slate 编辑器工具开发01 - Slate语法 & 常用控件
ue5·编辑器·游戏引擎·ue4
程序员爱德华2 小时前
VSCode git/gerrit解冲突
git·vscode·gerrit
疏狂难除16 小时前
JetBrains IDE插件开发教程(五)——File Header
ide·kotlin
Soari19 小时前
【突发暴更】Claude Code v2.1.208 :无障碍辅助模式正式上线、Vim 连击热键出逃、大修内存泄漏与跨域 AWS SSO 登录崩溃!
编辑器·vim·aws·claude code
harmful_sheep1 天前
idea相关设置
java·ide·intellij-idea
蓝冰凌1 天前
vscode 用户级 settings.json
ide·vscode·json
九九落1 天前
VSCode AI编程完全指南:从环境搭建到实战应用
ide·vscode·ai编程