Configure the compilation environment
launch.json
{
// Use IntelliSense to understand related properties.
// Hover to see the description of existing properties.
// For more information, please visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0" ,
"configurations" : [
{
"name": "g ++. exe build and debug active file " , " type ":" cppdbg " , " request ":" launch " ," program ":" $ {fileDirname} \\ $ {fileBasenameNoExtension} .exe " ," args " : [], "stopAtEntry": false , "cwd": "$ {workspaceFolder}" , "environment" : [], "externalConsole":: [ { "description": "为 gdb 启用整齐打印", "text": "-enable-pretty-printing", "ignoreFailures": true } ], "preLaunchTask": "g++" } ] }
setting.json
{
"files.associations": {
"iostream": "cpp",
"cstring": "cpp",
"array": "cpp",
"atomic": "cpp", "*.tcc": "cpp", "bitset": "cpp", "cfenv": "cpp", "charconv": "cpp", "chrono": "cpp", "cinttypes": "cpp", "clocale": "cpp", "codecvt": "cpp", "complex": "cpp", "condition_variable": "cpp", "csetjmp": "cpp", "csignal": "cpp", "cstdarg": "cpp", "cstddef": "cpp", "cstdio": "cpp", "ctime": "cpp", "cuchar": "cpp", "cwctype": "cpp", "deque": "cpp", "forward_list": "cpp", "list": "cpp", "unordered_map": "cpp", "unordered_set": "cpp", "vector": "cpp", "algorithm": "cpp", "functional": "cpp", "iterator": "cpp", "map": "cpp", "memory": "cpp", "memory_resource": "cpp", "numeric": "cpp", "optional": "cpp", "random": "cpp", "ratio": "cpp", "regex": "cpp", "set": "cpp", "string": "cpp", "string_view": "cpp", "system_error": "cpp", "tuple": "cpp", "type_traits": "cpp", "utility": "cpp", "fstream": "cpp", "future": "cpp", "iomanip": "cpp", "mutex": "cpp", "scoped_allocator": "cpp", "shared_mutex": "cpp", "sstream": "cpp", "thread": "cpp", "cctype": "cpp", "cmath": "cpp", "cstdint": "cpp", "cstdlib": "cpp", "cwchar": "cpp", "typeindex": "cpp", "typeinfo": "cpp", "valarray": "cpp", "concepts": "cpp", "exception": "cpp", "initializer_list": "cpp", "ios": "cpp", "iosfwd": "cpp", "istream": "cpp", "limits": "cpp", "new": "cpp", "ostream": "cpp", "stdexcept": "cpp", "streambuf": "cpp", "xfacet": "cpp", "xhash": "cpp", "xiosbase": "cpp", "xlocale": "cpp", "xlocinfo": "cpp", "xlocnum": "cpp", "xmemory": "cpp", "xstddef": "cpp", "xstring": "cpp", "xtr1common": "cpp", "xtree": "cpp", "xutility": "cpp", "filesystem": "cpp", "locale": "cpp", "queue": "cpp", "stack": "cpp", "xlocbuf": "cpp", "xlocmes": "cpp", "xlocmon": "cpp", "xloctime": "cpp" }, "C_Cpp.errorSquiggles": "Disabled" }
task.json
{
// 有关 tasks.json 格式的文档,请参见
// https://go.microsoft.com/fwlink/?LinkId=733558
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "g++",
"command": "C:\\MinGW\\bin\\g++.exe", "args": [ "-g", "${file}", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe", // "-std=c++17", ], "options": { "cwd": "C:\\MinGW\\bin", "env":{ "PYTHONIOENCODING": "UTF-8" } }, "problemMatcher": [ "$gcc" ], "group": { "kind": "build", "isDefault": true } } ] }