title: VS Code cannot open source file "opencv2/opencv.hpp"
body: <p>I am trying to include OpenCV library for my project. But VS Code keeps showing me the error:</p>
  <pre><code>#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/Users/erenerogullari/Desktop/School/DIP/dip02/main.cpp). 
  cannot open the source file 'opencv2/opencv.hpp'.
  </code></pre>
  <p>even though I added it to my include path in 'settings.json'.</p>
  <p>Here is my 'main.cpp' file:</p>
  <pre><code>#include &lt;opencv2/opencv.hpp&gt; // Error is shown here
  #include &lt;stdexcept&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;sstream&gt;
  
  using namespace std;
  using namespace cv;
  
  int main(int argc, char **argv){...}
  </code></pre>
  <p>And my 'setting.json' for C/C++ extension in VS Code:</p>
  <pre><code>{
      &quot;editor.formatOnSave&quot;: true,
      &quot;kite.showWelcomeNotificationOnStartup&quot;: false,
      &quot;C_Cpp.default.includePath&quot;: [&quot;${default}&quot;, &quot;/Users/eren/opencv-4.5.0/include/opencv2&quot;]
  }
  </code></pre>
  <p>I built the project using CMake Tools for VS Code. Here is my 'CMakeLists.txt' file if it's helpful in any way:</p>
  <pre><code>cmake_minimum_required(VERSION 3.1)
  
  project( dip2 LANGUAGES CXX )
  
  find_package( OpenCV REQUIRED )
  
  
  add_library(code 
      Dip2.cpp
      Dip2.h
  )
  
  set_target_properties(code PROPERTIES
      CXX_STANDARD 11
      CXX_STANDARD_REQUIRED YES
      CXX_EXTENSIONS NO
  )
  
  
  target_link_libraries(code
      PUBLIC
          ${OpenCV_LIBS}
  )
  
  target_include_directories(code PUBLIC ${OpenCV_INCLUDE_DIRS})
  
  
  add_executable(main 
      main.cpp 
  )
  
  set_target_properties(main PROPERTIES
      CXX_STANDARD 11
      CXX_STANDARD_REQUIRED YES
      CXX_EXTENSIONS NO
  )
  
  target_link_libraries(main 
      PRIVATE
          code
  )
  
  target_include_directories(main PUBLIC ${OpenCV_INCLUDE_DIRS})
  
  
  add_executable(unit_test 
      unit_test.cpp 
  )
  
  set_target_properties(unit_test PROPERTIES
      CXX_STANDARD 11
      CXX_STANDARD_REQUIRED YES
      CXX_EXTENSIONS NO
  )
  
  target_link_libraries(unit_test 
      PRIVATE
          code
  )
  
  target_include_directories(unit_test PUBLIC ${OpenCV_INCLUDE_DIRS})
  </code></pre>
  <p>I am using Visual Studio Code 1.51.1 on macOS 11.0.1. Thank you in advance!</p>