willSapgreen
willSapgreen

Reputation: 1475

VSCode IntelliSense Cannot Find Header

I add CUDA 10.2 examples into Visual Studio Code,

and follow VSCode intellisense with C++ headers

to edit settings.json.

However, IntelliSense still shows NVIDIA_CUDA-10.2_Samples/common/inc/helper_cuda.h not found.

Would you mind helping me with finding which part I miss?

Here is the screenshot of settings.json

enter image description here

Here is the screenshot of workspace hierarchy

enter image description here

Here is the screenshot of not found header

enter image description here

Upvotes: 1

Views: 7723

Answers (1)

Nikhil Augustine
Nikhil Augustine

Reputation: 197

Add includePath in .vscode/c_cpp_properties.json file

For example

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

You may add any path which outside workspaceFolder separately as one more parameter for includePath tag

Upvotes: 4

Related Questions