编译错误——Visual Studio Code中的#include错误
我在Visual Studio Code中尝试编译C 文件,但遇到了以下错误:
"#include错误已检测。请更新includePath。此翻译单元的波浪线已被禁用。"
我在论坛里搜索过,但还没有看到一个可行的解决方案
我的C/C++配置如下。
问题在于VS Code无法访问位于我的主C 源文件所在同一文件夹中的头文件。
{
"configurations": [
{
"name": "windows-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "C://mingw64/bin/gcc.exe",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x64",
"compilerArgs": [
""
]
}
],
"version": 4
解决方案
我认为你的编译器路径设置错了。应该是:
"compilerPath": "C:\\\\mingw64\\\\bin\\\\gcc.exe"
站内所有文章版权归属LeftHeroAI导航站,无授权禁止任何主体转载、抄袭、复制内容,亦不得私自架设镜像站点。一经侵权,本站将通过法律途径追责。