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
}
相关推荐
mcusun20002 小时前
VScode 使用Deepseek又方便又好用的另一款插件
ide·vscode·编辑器·deepseek
leoufung3 小时前
VIM FZF 安裝和使用
linux·编辑器·vim
CodeWithMe4 小时前
[ Vim ] 常用命令 and 配置
linux·编辑器·vim
luoyayun3614 小时前
Trae+Qt+MSVC环境配置
vscode·qt·环境配置·trae qt
莲动渔舟5 小时前
国产编辑器EverEdit - 洞察秋毫!内置文件比较功能!
编辑器·emeditor·notepad·everedit
HealthScience5 小时前
【异常错误】pycharm debug view变量的时候显示不全,中间会以...显示
ide·python·pycharm
waicsdn_haha8 小时前
Visual Studio Code 2025 安装与高效配置教程
c语言·ide·windows·vscode·微软·编辑器·win7
莲动渔舟10 小时前
国产编辑器EverEdit - 在编辑器中对文本进行排序
java·开发语言·编辑器
镰圈量化12 小时前
当电脑上有几个python版本Vscode选择特定版本python
开发语言·vscode·python
树欲静而风不止慢一点吧14 小时前
Visual Studio 2022配置网址参考
ide·visual studio