微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何解决 macOS 中 VSCode 中的 includePath 错误

如何解决如何解决 macOS 中 VSCode 中的 includePath 错误

自从我的 MacBook 更新后,我就无法解决“检测到 #include 错误。请更新您的 includePath”的错误。 这是我的 c_cpp_properties.json 文件

{
"configurations": [
    {
        "name": "Mac","includePath": [
            "${workspaceFolder}/**"
        ],"defines": [],"macFrameworkPath": [],"compilerPath": "/usr/local/bin/g++","cStandard": "gnu17","cppStandard": "gnu++14","intelliSenseMode": "macos-gcc-x64"
    }
],"version": 4

}

解决方法

{
"configurations": [
    {
        "name": "Mac","includePath": [
            "/usr/local/Cellar/gcc/10.2.0_4/include/c++/10.2.0/x86_64-apple-darwin20"
        ],"defines": [],"macFrameworkPath": [],"compilerPath": "/usr/local/bin/g++","cStandard": "gnu17","cppStandard": "gnu++14","intelliSenseMode": "macos-gcc-x64"
    }
],"version": 4

} 试试这条路

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。