I have the opencv
installed in /usr/include/opencv4
folder
I configured the VSCode as it should be, and the IntelliSense can detect the library.
The configuration should be correct (I guess)
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/opencv4/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
However, I get an error:
fatal error: opencv2/core.hpp: No such file or directory
2 | #include <opencv2/core.hpp>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
Am I missing something? Thanks
ls -l /usr/include/opencv4/opencv2/core.hpp
, do you see the file or get an error? If it's not there:sudo apt install libopencv-dev
-rw-r--r-- 1 root root 151612 Dec 20 2019 /usr/include/opencv4/opencv2/core.hpp
cpp
isn't a compiler in the normal sense, it's a pre-processor.gcc
is what you should use for C programs andg++
is what should be used for C++ programs.