- 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
toincludePath
.
{
"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
}