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

相关推荐
持敬chijing20 小时前
PHP开发-环境搭建-安装phpstudy-vscode工具
开发语言·vscode·php
csdn_aspnet21 小时前
Copilot能换成本地吗?VSCode接本地大模型本地化接入方案
ide·vscode·ai·ollama
大数据专业的小沉1 天前
解决PyCharm 2024.1 打开项目后持续卡顿,UI 无响应,编辑延迟明显
ide·python·pycharm
青 春 记 忆1 天前
零基础入门python04:用注册校验理解字典、集合和条件判断
开发语言·vscode·python·python3.11
ue星空1 天前
【Android Studio】中文汉化教程|设置中文界面方法
android·ide·android studio
00后程序员张1 天前
有没有更轻量的 iOS 开发环境?快蝎kxapp轻量化路径与构成
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
buhuizhiyuci1 天前
【Linux 网络篇】数据的 “循环系统“:协议认识与网络传输的流程
linux·运维·服务器·网络·vscode
猿小猴子2 天前
主流 Agent 之 「Zed」和 「ZCode」 介绍
ide·ai·agent·zed·zhipu·ade·zcode
ue星空2 天前
【Godot】更换编辑器外观主题
编辑器·游戏引擎·godot
没事学点编程小知识2 天前
免费的在线EPUB编辑器:E-Ink
编辑器