{// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387"version":"0.2.0","configurations":[{"name":"g++ build and debug active file","type":"cppdbg","request":"launch","program":"${fileDirname}/${fileBasenameNoExtension}","args":[],"stopAtEntry":false,"cwd":"${workspaceFolder}","environment":[],"externalConsole":false,"MIMode":"lldb",//调试器// 每次运行这个脚本前,先执行下面的task(task.json找)"preLaunchTask":"g++ build active file"}]}
2.2 配套任务tasks.json
{// See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format"version":"2.0.0","tasks":[{"type":"shell","label":"g++ build active file","command":"/usr/bin/g++","args":["-g","${file}","-o","${fileDirname}/${fileBasenameNoExtension}","-std=c++11"],"options":{"cwd":"/usr/bin"},"problemMatcher":["$gcc"],"group":"build"}]}