互联网技术 · 2024年2月19日

如何解决vscode检测到#include错误后需要更新includePath问题

这篇文章主要介绍了vscode检测到#include错误请更新includePath的解决方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧。

vscode检测到#include错误,请更新includePath。

解决方法

最近电脑重做,重新安装了一边vscode,但是写代码的时候发现头文件会标错,显示无法找到,下面是我的解决办法:

vscode检测到#include错误请更新includePath的解决方法

执行命令查看g++包含路径

g++ -v -E -x c++ –

vscode检测到#include错误请更新includePath的解决方法

复制上面红框的内容

在vscode中摁ctrl+shift+p搜索json文件

vscode检测到#include错误请更新includePath的解决方法

在includePath里面粘贴红框的库路径,注意双引号和逗号格式

vscode检测到#include错误请更新includePath的解决方法

如果再有问题,试试把”/usr/include”,放在第一行,如上,解决问题

vscode检测到#include错误请更新includePath的解决方法

到此这篇关于vscode检测到#include错误请更新includePath的解决方法的文章就介绍到这了。

OpenMagic API

Need more than content? Move into the product flow.

If you are here for model access, pricing, developer docs, or the future API console, the dedicated product path now lives on api.openmagic.ai.

登录免费注册