1 安装插件 C / C++ 2 配置include 出现“#include errors detected.”时,按ctrl + .跳转进入配置,或者打开c_cpp_properties.json直接配置: { "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/**", // add following lines "/usr/include/", "/usr/local/include" ], "defines": [], "compilerPath": "/usr/bin/gcc", "cStandard": "c17", "cppStandard": "gnu++17", "intelliSenseMode": "linux-gcc-x64" } ], "version": 4 } 3 配置工程下多cpp文件 默认项目中只编译当前cpp(main),如果你是分多个cpp文件写的,会提示“undefined reference to ...” 需要修改task.json: { "tasks": [ { "type": […]