更改cpp_properties.json
最關鍵的一點,"cppStandard": "C++11".
launch.json
tasks.json
{ "tasks": [ { "type": "shell", "label": "g++ build active file", "command": "/usr/bin/g++", "args": [ "-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}", "-std=c++11", "-lpthread" ], "options": { "cwd": "/usr/bin" } } ], "version": "2.0.0" }