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

相关推荐
熊猫钓鱼>_>23 分钟前
在VSCode中更新或安装最新版的npx和uv工具
ide·vscode·uv
ONLYOFFICE1 小时前
【技术教程】如何将文档编辑器集成至基于Java的Web应用程序
java·编辑器·onlyoffice
深耕AI2 小时前
【MFC 小白日记】对话框编辑器里“原型图像”到底要不要勾?3 分钟看懂!
c++·编辑器·mfc
猫头虎2 小时前
IDE mac M芯片安装报错:如何解决“InsCode.app 已损坏”,无法打开
ide·vscode·macos·inscode·编辑器·idea·mac
MicrosoftReactor3 小时前
技术速递|Copilot 的 Next Edit Suggestions(NES)现已在 JetBrains IDE 中开放公测
ide·copilot
n123523512 小时前
AI IDE+AI 辅助编程,真能让程序员 “告别 996” 吗?
ide·人工智能
蔗理苦13 小时前
2025-09-04 HTML1——环境配置与简介
css·vscode·html
小冷coding15 小时前
随时随地写代码:Jupyter Notebook+cpolar让远程开发像在本地一样流畅
ide·python·jupyter
Adorable老犀牛18 小时前
阿里云-基于通义灵码实现高效 AI 编码 | 1 | 在 Visual Studio Code 中安装和使用灵码
vscode·阿里云·云计算
卿·静20 小时前
Node.js轻松生成动态二维码
前端·javascript·vscode·node.js·html5