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

相关推荐
色空大师4 小时前
【debug调试详解-idea】
java·ide·intellij-idea·调试·远程调试
女神下凡7 小时前
这是 Cursor(Composer) 的五种核心交互模式
服务器·人工智能·windows·vscode·microsoft
Tiger Z7 小时前
Positron 教程7 --- 工作区
ide·编程·positron
木囧8 小时前
PyCharm手动创建虚拟环境
ide·python·pycharm
生信碱移9 小时前
Vscode 连接 ipynb 选择内核无法自动显示 conda 环境对应的 python
服务器·人工智能·经验分享·vscode·python
爱就是恒久忍耐10 小时前
VSCode里clangd如何配置跳转
ide·vscode·编辑器
SmartManWind10 小时前
vscode中claude-code插件wsl中开启自动模式
ide·vscode·编辑器·claude code
Watink Cpper11 小时前
VSCode通过ChatGPT5.5登陆codex:sign-in could not be complete 问题解决方案
ide·vscode·编辑器·codex·gpt5.5
相醉为友12 小时前
Trae IDE WSL2/SSH 环境网络故障排查笔记
ide·笔记·ssh
qq_1958216513 小时前
2. 开发环境搭建:IDE安装与配置、交叉编译工具链、调试工具准备
ide