# #include errors detected in vscode
# 问题描述
在VSCode种开发CMake C++工程时,经常会碰到#include errors detected的错误。
#include errors detected. Please update your includePath. IntelliSense features for this translation unit (/path/to/project/xxx.cpp) will be provided by the Tag Parser.
# 解决办法
对于这种情况,如果在正确设置cpp_xx.json中include_path后依然报错,有人给出的办法是重新启动VSCode,某些情况下这种做法能起到作用。理解类似于CLion中更新了工程文件的索引。 如何手动刷新VSCode中工程文件的索引呢?这个以后再探索。
另外一种办法,是修改配置文件c_cpp_properties.json中的configurationProvider字段,
将
{
"configurationProvider":"ms-vscode.cmake-tools"
}
修改成
{
"configurationProvider":"ms-vscode.cpptools"
}
或者可以尝试直接删除这个字段。