Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save saratrajput/9900fd63531eb91751ee57d742cf8a03 to your computer and use it in GitHub Desktop.
Save saratrajput/9900fd63531eb91751ee57d742cf8a03 to your computer and use it in GitHub Desktop.
OpenCV C++ Intellisense for VSCode on Ubuntu 20
  • First locate OpenCV files on your machine.

If locate is not installed, install it with: sudo apt install mlocate. You might get results like:

locate opencv.hpp                                                                                                                                                                             (py37_test) 
/usr/include/boost/compute/interop/opencv.hpp
/usr/include/opencv4/opencv2/opencv.hpp
  • In VSCode, Press Ctrl+Shift+P.
  • Search and open C/C++: Edit configuration (JSON).
  • Append the path /usr/include to includePath.
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
                "/usr/include/"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++14",
            "intelliSenseMode": "linux-clang-x64",
            "configurationProvider": "ms-vscode.cmake-tools"
        }
    ],
    "version": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment