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

相关推荐
不知所云,10 分钟前
3. lvgl 9.3 vscode 模拟环境搭建 lv_port_pc_vscode-release-v9.3
ide·vscode·编辑器·c·sdl·lvgl vscode·lvgl模拟器
墨小傲2 小时前
基于Linux下的vscode c/c++开发环境搭建详细教程
linux·c语言·vscode
淡漠的蓝精灵2 小时前
【2025】Sublime Text 4安装教程保姆级一键安装教程(附安装包)
其他·编辑器·sublime text
Percep_gan2 小时前
idea的使用小技巧,个人向
java·ide·intellij-idea
tan180°11 小时前
MySQL表的操作(3)
linux·数据库·c++·vscode·后端·mysql
万千思绪15 小时前
【PyCharm 2025.1.2配置debug】
ide·python·pycharm
我在看世界17 小时前
家里vscode连公司内网vscede
vscode·ssh
不想迷路的小男孩19 小时前
Android Studio 中Palette跟Component Tree面板消失怎么恢复正常
android·ide·android studio
AlickLbc20 小时前
在phpstudy环境下配置搭建XDEBUG配合PHPSTORM的调试环境
ide·phpstorm
悠悠小茉莉20 小时前
Win11 安装 Visual Studio(保姆教程 - 更新至2025.07)
c++·ide·vscode·python·visualstudio·visual studio