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
}
相关推荐
知远同学12 小时前
Pycharm顶部菜单栏固定显示
ide·python·pycharm
Everybody_up13 小时前
pycharm中编译环境配置
ide·python·pycharm
Franklin15 小时前
移植一个Pycharm的复杂项目:
ide·python·pycharm
夜雨听萧瑟15 小时前
VSCode的clangd插件简单介绍和使用
vscode
技术小甜甜17 小时前
【Godot】【入门】GDScript 快速上手(只讲游戏里最常用的 20% 语法)
android·游戏·编辑器·游戏引擎·godot
farewell-Calm19 小时前
Android Studio 添加第三方库
android·ide·android studio
GDAL19 小时前
vscode 使用正则查找替换
ide·vscode·正则表达式·编辑器
WLDLSW20 小时前
windows上jupyter notebook增加标题目录功能
ide·windows·jupyter
拆房老料20 小时前
文档能力中台化实践:一份面向自研Office处理产品的理性技术选型说明
编辑器·开源软件
MounRiver_Studio20 小时前
RISC-V IDE MRS2使用笔记(十三):添加自定义工程模板
ide·mcu·risc-v·嵌入式开发