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

相关推荐
跃渊Yuey1 小时前
【Linux】Linux进程信号产生和保存
linux·c语言·c++·vscode
ONLYOFFICE2 小时前
树莓派办公套件:ONLYOFFICE 桌面编辑器安装教程
编辑器·github·onlyoffice
102400242 小时前
vscode无法选择conda虚拟环境下的解释器
ide·vscode·conda
网络安全研发随想2 小时前
AI Code编辑器到底是怎么做出来的?
人工智能·编辑器
凯子坚持 c2 小时前
在 Visual Studio 2019 中配置 Qt 插件开发环境:编译原理 + 底层逻辑解析
ide·qt·visual studio
yuhaiqun19893 小时前
SQL+VSCode实战指南:AI赋能高效数据库操作
数据库·人工智能·经验分享·vscode·sql·学习·学习方法
好大哥呀3 小时前
常见的IDE有哪些?
ide
热爱生活的五柒3 小时前
配置vscode的ssh离线部署,但是Stable-cmmit-id一直会后面添加个staging这个后缀将文件名修改
ide·vscode·ssh
duansamve3 小时前
VSCode中如何搭建JAVA+MAVEN开发环境?
java·vscode·maven
傅科摆 _ py3 小时前
Vim 常用命令简要总结
linux·编辑器·vim