vscode文件配置

lanuch.json

cpp 复制代码
{
    "version": "0.2.0",
    "configurations": [

      {
        "name": "(gdb) 启动",
        "type": "cppdbg",
        "request": "launch",
        // "program": "输入程序名称,例如 ${workspaceFolder}/a.exe",
        "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${fileDirname}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "E:\\vscode\\mingw\\bin\\gdb.exe",
        "setupCommands": [
            {
                "description": "为 gdb 启用整齐打印",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            },
            {
                "description": "将反汇编风格设置为 Intel",
                "text": "-gdb-set disassembly-flavor intel",
                "ignoreFailures": true
            }
        ]
      },

      {
        // "justMyCode":false,
        "name": "(gdb) Launch", 
        "type": "cppdbg", 
        "request": "launch", 
        "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", 
        "args": [], 
        "stopAtEntry": false,
        "cwd": "${workspaceRoot}",
        "environment": [],
        "externalConsole": true, 
        "MIMode": "gdb",
        "miDebuggerPath": "E:\\vscode\\mingw\\bin\\gdb.exe",
        "preLaunchTask": "g++",
        "setupCommands": [
          {
            "description": "Enable pretty-printing for gdb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
          }
        ]
      }
    ]
  }

tasks.json

cpp 复制代码
{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "cppbuild",
			"label": "g++",
			"command": "E:/vscode/mingw/bin/g++.exe",
			"args": [
				"-fdiagnostics-color=always",
				"-g",
				"${file}",
				"-o",
				"${fileDirname}\\${fileBasenameNoExtension}.exe",
			],
			"options": {
				"cwd": "E:/vscode/mingw/bin"
			},
			"problemMatcher": [
				"$gcc"
			],
			"group": {
				"kind": "build",
				"isDefault": true
			},
			"detail": "编译器: E:/vscode/mingw/bin/g++.exe"
		}
	]
 

}

c_cpp_properties.json

cpp 复制代码
{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "E:/vscode/mingw/bin/g++.exe",
            "cStandard": "c17",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "gcc-x64"
        }
    ],
    "version": 4
}
相关推荐
lanhuazui1014 小时前
【Vscode】显示多个文件 & 打开多个文件时实现标签栏多行显示
vscode·编辑器
八月正好an16 小时前
visual studio安装本地帮助手册
ide·visual studio
张较瘦_17 小时前
环境搭建 | [入门级]VSCode(Cursor|Trae|Qoder)搭建Java(Springboot3)企业开发环境全流程
java·ide·vscode
生莫甲鲁浪戴18 小时前
Android Studio新手开发第二十一天
android·ide·android studio
生莫甲鲁浪戴18 小时前
Android Studio新手开发第二十二天
android·ide·android studio
天赐细莲19 小时前
(Linux) WSL 通过 VSCode 连接不执行 profile 问题(登录Shell问题)
linux·运维·vscode
暮色驶过苍茫1 天前
VSCode 配置 SSH 远程连接
ide·vscode·ssh
lichong9511 天前
Android studio 修改包名
android·java·前端·ide·android studio·大前端·大前端++
微风粼粼1 天前
eclipse 导入javaweb项目,以及配置教程(傻瓜式教学)
java·ide·eclipse
fruge2 天前
Visual Studio 2022安装时共享组件、工具、SDK路径无法更改的问题
ide·visual studio