#include 检测到错误。请更新您的 includePath。该翻译单元禁用了波浪线
在使用 C/C++ 扩展 在 VSCode 中编辑我的名为“mmap.c”的文件时,我注意到当我将鼠标悬停在上面时,标记为“#include”的所有行都有红线,并显示以下消息错误最上面的“#include”:
检测到#include 错误。请更新您的 includePath。此翻译单元 (C:\Users\MyName\Documents\OS\mmap.c) 的波浪线被禁用。
然后我单击“快速修复”,弹出的第一个选项是“编辑' >包含路径'设置。”。然后我选择了它,它把我带到了“C/C++ Configurations”选项卡。在“编译器路径”部分正上方的该选项卡上,它指出我的编译器路径是/usr/bin/gcc,但是在它的正下方有一个红色框,内容如下: 找不到: C:\Users\MyName\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\usr/bin/gcc
我还可以单击 C 给出的 c_cpp_properties.json 文件/C++ 扩展向下滚动,我们找到“CompilerPath”部分,其中指出“CompilerPath:'/usr/bin/gcc'”,并用警告黄线下划线说明上述“找不到:”
有谁知道导致此错误的原因以及如何修复我的问题编译器路径,这样我就不会在文件中不断收到 #include 错误?
while editing a file of mine called "mmap.c" in VSCode using the C/C++ extension I noticed that all the lines tagged "#include" had red lines with the following message error when I hovered over the top most "#include":
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\Users\MyName\Documents\OS\mmap.c).
I then clicked on "Quick Fix" and the first option I that popped up was "Edit 'IncludePath'setting.". I then selected that and it brought me to the "C/C++ Configurations" tab. On that tab right over the section "Compiler Path" it states that my compiler path is /usr/bin/gcc however right below it there's a red box that says as follows:
Cannot find:
C:\Users\MyName\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\usr/bin/gcc
I can also click on the c_cpp_properties.json file given by the C/C++ extension scrolling down we find the "CompilerPath" section which states "CompilerPath:'/usr/bin/gcc'," and is underlined by a warning yellow line stating the above mentioned "Cannot find: "
Does anyone know what's causing this error and how I can fix my compiler path so I don't keep getting #include errors in my file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论