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

相关推荐
诚信定制8393 小时前
Typora插件开发指南:打造专属IDE式写作环境
ide
Tian_Hang6 小时前
Eclipse Ditto 物模型相关代码
java·运维·服务器·ide·eureka·eclipse
Tian_Hang11 小时前
Eclipse Ditto 节流机制
java·ide·eclipse
DogDaoDao11 小时前
AI 编程 IDE 全景解析 2026:Agent 全面接管开发链路
ide·人工智能·程序员·ai编程·claude·cursor·ai agent
你家人养牛11 小时前
OOC Relation Plugin:C 语言面向对象 开发的高效辅助工具
c语言·vscode
林熙蕾LXL12 小时前
VSCode调试
ide·vscode·编辑器
2501_9423895513 小时前
小米寥寥几家车企设计汽车顶棚
华为·编辑器·时序数据库·harmonyos
测试工程师成长之路13 小时前
Typora插件开发指南:打造专属IDE式写作环境
ide
菜地里的小菜鸟14 小时前
vscode接入claudecode
vscode·claude code·vscode接入claudecode
π同学15 小时前
ESP-IDF+vscode开发ESP32第十七讲——USB设备栈
vscode·esp32·usb