vscode windows下 tasks.json 和 launch.json

tasks.json

bash 复制代码
{
    "tasks": [
        {
            "type": "shell",
            "label": "g++ build active file",
            "command": "C:\\Program Files\\mingw64\\bin\\g++.exe",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "C:\\Program Files\\mingw64\\bin"
            }
        },
        {
            "type": "cppbuild",
            "label": "C/C++: g++ 生成活动文件",
            "command": "C:\\Program Files\\mingw64\\bin\\g++.exe",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": "build",
            "detail": "编译器: C:\\Program Files\\mingw64\\bin\\g++.exe"
        }
    ],
    "version": "2.0.0"
}

launch.json

bash 复制代码
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "g++ - 生成和调试活动文件",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "C:\\Program Files\\mingw64\\bin",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "为 gdb 启用整齐打印",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "g++ build active file",
            "miDebuggerPath": "C:\\Program Files\\mingw64\\bin\\gdb.exe",
        }
    ]
}
相关推荐
生产队队长16 小时前
Web:免费的JSON接口
json
Honmaple18 小时前
中国四级城市联动数据,包含港澳台,内含json , sql , python 脚本
python·sql·json
Linux编程用C20 小时前
Docker+Vscode搭建(本地/远程)开发环境
vscode·后端·docker
巴拉巴拉~~1 天前
Flutter 通用轮播图组件 BannerWidget:自动播放 + 指示器 + 全场景适配
windows·flutter·microsoft
双河子思1 天前
Windows API 积累
windows
OliverH-yishuihan1 天前
在 Windows 上安装 Linux
linux·运维·windows
慧都小项1 天前
Parasoft Jtest 如何用 JSON 文件驱动Java 测试自动化
java·自动化·json
淼淼7631 天前
工厂方法模式
开发语言·c++·windows·qt·工厂方法模式
一位代码1 天前
python | 将字典类型数据保存成 json 文件及读取 json 文件方法
json
ForteScarlet1 天前
如何解决 Kotlin/Native 在 Windows 下 main 函数的 args 乱码?
开发语言·windows·kotlin