title: Visual Studio Code "cannot open source file" error when including OpenCV
body: <p>I'm using Visual Studio Code to develop a C++ project, and I have OpenCV installed in a custom location. However, it complains with the following error when I try to include header files from OpenCV:</p>
  
  <blockquote>
    <p>#include errors detected. Consider updating your compile_commands.json or includePath. Squiggles are disabled for this translation unit (/home/.../dev/communication-module/modules/.../.../src/....cpp). C/C++(1696)<br>
    cannot open source file "opencv2/core/mat.hpp" C/C++(1696)</p>
  </blockquote>
  
  <p>Here is a screenshot of the same error:</p>
  
  <p><a href="https://i.stack.imgur.com/SGyIV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/SGyIV.png" alt="enter image description here"></a></p>
  
  <p>My <code>.vscode/c_cpp_properties.json</code> file looks as follows:</p>
  
  <pre><code>{
      "configurations": [
          {
              "name": "Linux",
              "includePath": [
                  "/opt/sdk/sysroots/corei7-64-poky-linux/usr/include/opencv2",
                  "/opt/sdk/sysroots/corei7-64-poky-linux/usr/include/opencv2/core",
                  "${workspaceFolder}/**"
              ],
              "defines": [],
              "compilerPath": "/usr/bin/gcc",
              "cStandard": "c11",
              "cppStandard": "c++17",
              "intelliSenseMode": "clang-x64",
              "compileCommands": "${workspaceFolder}/build/compile_commands.json",
              "browse": {
                  "path": [
                      "/opt/sdk/sysroots/corei7-64-poky-linux/usr/include/opencv2",
                      "/opt/sdk/sysroots/corei7-64-poky-linux/usr/include/opencv2/core",
                      "${workspaceFolder}"
                  ],
                  "limitSymbolsToIncludedHeaders": true,
                  "databaseFilename": ""
              }
          }
      ],
      "version": 4
  }
  </code></pre>
  
  <p>And the <code>mat.hpp</code> file is clearly there:</p>
  
  <pre><code>$ ls /opt/sdk/sysroots/corei7-64-poky-linux/usr/include/opencv2/core | grep mat.hpp
  mat.hpp
  </code></pre>
  
  <p>Still, Visual Studio Code does not pick it up. Why is that? What else should I change for Visual Studio Code to find my OpenCV header files?</p>