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

相关推荐
on_pluto_3 小时前
【debug】vscode 和 codex 不兼容问题
ide·人工智能·vscode·编辑器
阿鹿.3 小时前
Claude code
vscode
Web - Anonymous7 小时前
Vue3 + Element Plus 集成 JSON Editor 实现实时校验 JSON 编辑器(高亮/暗亮主题/分栏回显/组件复用) - 附完整示例
vue.js·编辑器·json
pan_junbiao7 小时前
Visual Studio Code的应用:笔记
vscode
一杯原谅绿茶8 小时前
VSCode的Eclipse插件-编译Eclipse项目
ide·vscode·eclipse
etc95271 天前
keil下如何指定stack和heap地址
ide·mcu
JTaoX1 天前
PyCharm 连接本地虚拟机完整指南
ide·python·pycharm
迷路爸爸1801 天前
cursor资源管理器修改为与vscode一样的纵向布局
ide·vscode·编辑器
TO_ZRG1 天前
Unity 编辑器之 EditorTool、EditorToolBar、Overlay属性
编辑器
星羽XingYu1 天前
esp32 vscode clangd 无法索引库函数解决方案
ide·vscode·编辑器