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

相关推荐
CaptainDrake1 小时前
React低代码项目:问卷编辑器
react.js·低代码·编辑器
Williams101 小时前
解锁高效开发新姿势:Trae AI编辑器深度体验
人工智能·编辑器
技术咖啡馆C1 小时前
二、IDE集成DeepSeek保姆级教学(使用篇)
ide·ai编程·idea-plugin·deepseek
新时代丘鸣山11 小时前
Idea java项目结构介绍
java·ide·intellij-idea
白云千载尽15 小时前
ubuntu环境中安装latex并使用vscode
linux·vscode·ubuntu
亚林瓜子16 小时前
IDEA撤销commit
java·ide·intellij-idea
椰萝Yerosius17 小时前
计算机工具基础(五)——Vim
linux·编辑器·vim
coco_1998_218 小时前
【Win10】Anaconda + Pycharm 环境搭建教程
ide·python·pycharm
m0_748234081 天前
Node.js使用教程
node.js·编辑器·vim
朗迹 - 张伟1 天前
UE5 编辑器辅助/加强 插件搜集
ue5·编辑器