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

相关推荐
xiaobobo33301 小时前
vscode+clangd打开头文件发现某些标识符不识别为“白色”语言模型识别为C++
vscode·识别头文件错误·标识符为白色·语言模型识别错误
AI小百科3 小时前
开源AI编辑器的未来发展趋势
人工智能·编辑器
专注VB编程开发20年6 小时前
Python 的 C 扩展,本质上就是“去中心化的 COM”
java·服务器·开发语言·ide·python
技术探讨者7 小时前
极境导表工具 —— 让配置数据成为游戏开发的效率引擎
unity·编辑器·ai编程·游戏策划
AI小百科8 小时前
目前开源AI编辑器面临的主要挑战是什么
人工智能·开源·编辑器
接着奏乐接着舞8 小时前
vscode 给 Maven 启动的 JVM 加上 `-Dfile.encoding=UTF-8`
jvm·vscode·maven
爱吃龙利鱼8 小时前
MobaXterm连接ubuntu26.04无法在vim界面粘贴问题解决方法(粘贴会提示进入进入可视模式VISUAL))
linux·ubuntu·编辑器·vim
秋99 小时前
Cursor 编辑器:下载、安装与深度使用详解
编辑器
资深流水灯工程师10 小时前
STM32CubeIDE for VSCode 完整安装与使用指南
vscode
小则又沐风a10 小时前
一步搞定Xshell远程连接vscode的问题
ide·vscode·编辑器