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",
        }
    ]
}
相关推荐
lvcoc11 小时前
unity 接入火山引擎API,包括即梦AI
windows·unity·ai·火山引擎
vortex514 小时前
AD渗透中服务账号相关攻击手法总结(Kerberoasting、委派)
windows·网络安全·渗透测试·ad
战南诚18 小时前
前端开发vscode插件 - live server
ide·vscode·编辑器
一个很老的小萌新19 小时前
json 解析 [{“id“:1,“name“:“apple“},{“id“:2,“name“:“banana“}]
java·前端·json
墨抒颖 msy.plus21 小时前
[特殊字符] 从零到一:打造你的VSCode圈复杂度分析插件
ide·vscode·编辑器·插件·cursor
一点都不方女士1 天前
《无畏契约》游戏报错“缺少DirectX”?5种解决方案(附DirectX修复工具)
windows·游戏·microsoft·动态链接库·directx·运行库
0wioiw01 天前
Python基础(①⑧Queue)
windows·python
寒水馨1 天前
Windows 11 手动下载安装配置 uv、配置国内源
windows·python·国内源·uv·windows11
Mintind1 天前
windows找不到gpedit.msc(本地组策略编辑器)
windows