【问题标题】:VSCode IntelliSense Cannot Find HeaderVSCode IntelliSense 找不到标头
【发布时间】:2020-07-08 04:53:22
【问题描述】:

我将 CUDA 10.2 示例添加到 Visual Studio Code 中,

并关注VSCode intellisense with C++ headers

编辑 settings.json。

但是,IntelliSense 仍然显示 NVIDIA_CUDA-10.2_Samples/common/inc/helper_cuda.h not found。

你介意帮我找出我错过的部分吗?

这是settings.json的截图

这是工作区层次结构的截图

这里是找不到标题的截图

【问题讨论】:

    标签: c++ visual-studio-code cuda intellisense


    【解决方案1】:

    在 .vscode/c_cpp_properties.json 文件中添加 includePath

    例如

    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
            ],
            "defines": [
                ""
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c11",
            "cppStandard": "c++11",
            "intelliSenseMode": "clang-x64"
        }
    

    您可以单独添加任何在workspaceFolder之外的路径作为includePath标签的另一个参数

    【讨论】:

    • 感谢您的快速回复。你能分享c_cpp_properties.json的整个路径吗?我搜索了我的本地 VS 代码安装路径,但找不到 c_cpp_properties.json。还是您自己创建文件?
    • 你的工作空间文件夹下有一个隐藏文件夹,即{work-space-folder}/.vscode/c_cpp_properties.json
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-05-11
    • 1970-01-01
    • 2015-07-19
    • 2022-07-25
    • 2017-03-09
    • 1970-01-01
    • 2019-10-14
    相关资源
    最近更新 更多