1

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

talonmies
  • 70,661
  • 34
  • 192
  • 269
willSapgreen
  • 1,365
  • 2
  • 17
  • 27

1 Answers1

3

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

Nikhil Augustine
  • 187
  • 2
  • 12
  • Thank you for the quick response. Can you share the whole path of c_cpp_properties.json? I searched my local VS code installation path but cannot find c_cpp_properties.json. Or do you create the file by yourself? – willSapgreen Jul 17 '20 at 04:06
  • There is a hidden folder under your workspace folder, which is {work-space-folder}/.vscode/c_cpp_properties.json – Nikhil Augustine Jul 17 '20 at 07:52