一、软件下载
- vscode(必须netframe4.6.2)
官网链接: vscode帮助及下载 - mingw
官网链接: mingw离线下载
二、VsCode配置
- task.json(生成)
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "C/C++: g++.exe build active file",
"command": "D:\\mingw64\\bin\\g++.exe",
"args": ["-g", "${fileDirname}\\*.c*", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe"],
"options": {
"cwd": "D:\\mingw64\\bin"
},
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
- launch.json(调试)
{
"version": "0.2.0",
"configurations": [
{
"name": "g++.exe - launch",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "D:\\mingw64\\bin",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe build active file"
}
]
}
- c_cpp_properties.json(自动提示)
{
"configurations": [
{
"name": "GCC",
"includePath": [
"D:\\mingw64\\bin\\**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "D:\\mingw64\\bin\\g++.exe",
"cStandard": "c11",
"intelliSenseMode": "windows-gcc-x64",
"cppStandard": "c++17"
}
],
"version": 4
}