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

相关推荐
跃龙客3 小时前
Visual Studio项目文件配置三方库笔记
ide·笔记·visual studio
焚 城3 小时前
Visual Studio 2026安装体验
ide·visual studio
牢七7 小时前
Slim-4.x php审计 报错分析
android·开发语言·ide·安全·php
cuckooman7 小时前
Build Tools for Visual Studio 2022 如何下载
ide·visual studio
FakeOccupational7 小时前
【VSCODE 插件 调试】 Visual Studio Code + Continue + Ollama实现本地版 Cursor / Copilot
ide·vscode·copilot
马猴烧酒.8 小时前
【JAVA算法|hot100】贪心算法类型题目详解笔记
java·开发语言·ide·笔记·算法·spring·贪心算法
山峰哥10 小时前
SQL优化全攻略:从索引策略到Explain实战解析
大数据·数据库·sql·oracle·性能优化·编辑器
golang学习记11 小时前
IDEA 2026.1 EAP 5 发布:K2模式更强了!
java·ide·intellij-idea
电子科技圈1 天前
从工具到平台:如何化解跨架构时代的工程开发和管理难题
人工智能·设计模式·架构·编辑器·软件工程·软件构建·设计规范
JohnnyCS1 天前
VSCode 自动换行设置完全指南
vscode·编辑器