win10+VSCode 出现#include errors detected. Please update your includePath.

  首先你得确定已经完成VSCode里的C++配置和MinGW安装,你的cpp程序能够正常运行。我报错情况是:在能编译运行情况下,#include下有波浪线,并报错:

#include errors detected. Please update your includePath.....

  首先参考博客,在cmd中输入gcc -v -E -x c++ -找到包含.h的文件夹include,根据

E:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/include

找到实际路径为:

E:\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\x86_64-w64-mingw32\include

  然后参考博客,将c_cpp_properties.json中的includePath修改,注意include/**,修改如下:

"includePath": [
     "${workspaceFolder}/**",
     "E:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/**"
 ]
发布了27 篇原创文章 · 获赞 10 · 访问量 5013

猜你喜欢

转载自blog.csdn.net/l1l1l1l/article/details/101056831