其他分享
首页 > 其他分享> > vscode配置

vscode配置

作者:互联网

参考下面这两个:

  1. https://zhuanlan.zhihu.com/p/87864677
  2. https://blog.csdn.net/bat67/article/details/76095813

另外附上我自己的配置:
修改路径:D:\LenovoSoftstore\mingw64\…后可以直接使用
c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.18362.0",
            "compilerPath": "D:\\LenovoSoftstore\\mingw64\\bin\\gcc.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "macos-gcc-x64"
        }
    ],
    "version": 4
}

launch.json

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "D:/LenovoSoftstore/mingw64/bin/gdb.exe",
            "preLaunchTask": "g++",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

tasks.json

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "shell",
			"label": "g++",
			"command": "D:/LenovoSoftstore/mingw64/bin/g++.exe",
			"args": [
				"-g",
				"${file}",
				"-o",
				"${fileDirname}/${fileBasenameNoExtension}.exe"
			],
			"options": {
				"cwd": "${fileDirname}"
			},
			"problemMatcher": [
				"$gcc"
			],
			"group": {
				"kind": "build",
				"isDefault": true
			},
			"detail": "编译器: D:/LenovoSoftstore/mingw64/bin/g++.exe"
		}
	]
}

标签:bin,LenovoSoftstore,vscode,配置,mingw64,fileDirname,gdb,exe
来源: https://blog.csdn.net/qq_45893475/article/details/118882726