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

相关推荐
神码编程15 小时前
【Unity】MiniGame编辑器小游戏(十六)中国象棋局域网对战【Chinese Chess】(下)
unity·编辑器·游戏引擎·小游戏
VIV-1 天前
Pycharm项目上传到Github
ide·pycharm·github
OsDepK1 天前
AudioSplit音频多轨免费分离工具即将发布
ide·git·python·音视频·集成学习
xingyuzhisuan1 天前
Jupyter Notebook 云GPU配置全解析(含实操+选型指南)
ide·python·jupyter·gpu算力
屋外雨大,惊蛰出没1 天前
Vscode自动生成类图
ide·vscode·编辑器·类图绘制
ONLYOFFICE1 天前
ONLYOFFICE 文档9.4发布:许可证更新、电子表格的深色模式、水平分隔线、新幻灯片主题与切换等
编辑器·onlyoffice
qq_14030341441 天前
vscode过滤文件
ide·vscode·编辑器
Lust Dusk1 天前
2026年最新phpstorm安装下载教程(附带激活链接)
网络·ide·安全·网络安全·phpstorm
app开发工程师V帅1 天前
Xcode 工程内引入工程、framework内引入framework、OC的framework引入swift 的framework等等
ide·macos·xcode
BestOrNothing_20152 天前
VS Code 中 Codex 功能详解:登录、IDE上下文、Token窗口、使用额度与重连问题说明
ide·agent·token·vs code·codex·reconnection