先安装c++插件
生成c_cpp_properties.json
快捷键ctrl + shift + p
, 找到C/C++: Edit Configurations (JSON)
运行gcc交叉编译器, 附带参数-v -E -x c++ -
xxxx-gcc -v -E -x c++ -
会输出
#include <...> search starts here:
底下的就是include路径
把这些路径都放到
c_cpp_properties.json里面的“includePath”
数组里
就可以解决这个问题了