c_cpp_properties.json
{
"configurations": [
{
"name": "windows-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
// "windowsSdkVersion": "10.0.19041.0",
"compilerPath": "D:/TDM-GCC-64/bin/g++.exe", // 此处双引号内的 D:/TDM-GCC-64 改为刚才安装编译器的路径,后面的 /bin/g++.exe 不动
"cStandard": "c11",
"cppStandard": "c++14",
"intelliSenseMode": "${default}",
"compilerArgs": []
}
],
"version": 4
}
launch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "D:/TDM-GCC-64/bin/gdb.exe",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "将反汇编风格设置为 Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe 生成活动文件"
}
]
}
settings.json
{
"files.associations": {
"cstdio": "cpp",
"queue": "cpp",
"climits": "cpp"
}
}
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe 生成活动文件",
"command": "D:\\TDM-GCC-64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}.exe",
"-std=c++14"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "编译器: D:\\TDM-GCC-64\\bin\\g++.exe"
}
]
}
标签:bin,GCC,exe,VSCode,配置,gdb,++.,64
From: https://www.cnblogs.com/TS357051/p/17078004.html