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

相关推荐
xx~t6 小时前
嵌入式——Linux软件编程——网络1
linux·c语言·网络·vscode·网络协议
sunburn-8 小时前
Java堆(Heap)详解与实战教学
java·开发语言·数据结构·ide·算法
Data_Journal8 小时前
Scrapyd:分步教程
开发语言·python·microsoft·golang·编辑器·html·iphone
逐步前行11 小时前
ESP32-S3-VSCode扩展ESP-IDF
ide·vscode·编辑器
171320330计算机毕设编程13 小时前
2027计算机毕设五大方向对比&选题推荐
java·ide·python·算法·django·php·推荐算法
2501_9160088915 小时前
Flutter 开发 iOS,项目打包成 IPA,命令与免 Xcode两种方法
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
zhangfeng11333 天前
WebIDE 容器中 AtomCode 报 `ATOMCODE_SIG_STALE` 排查实录:一次由 8 小时时钟偏差引发的“悬案”
编辑器·ai编程·atomcode
witton3 天前
MacOS中在目录或者文件右键菜单中添加“使用VSCode打开”
vscode·macos·文件·目录·服务·automator·右键菜单
wabil3 天前
[AI-Talk] codx制作xmind文件技巧
ide·ai编程·myeclipse·xmind
大衛說3 天前
02 · 环境搭建:uv 包管理与现代 IDE
ide·uv