I was using this guide to build OpenCV from the source.
https://linuxize.com/post/how-to-install-opencv-on-ubuntu-20-04/
Now I am using meson to build and compile my project. I am trying to use 2 different methods to include OpenCV in my project and both ways work.
Method 1:
cv2 = dependency('OpenCV', method: 'cmake')
Method 2:
cv2 = dependency('opencv4', required: true)
when I compile with meson I get:
Dependency opencv4 found: YES 4.6.0 (cached)
Has header "opencv4/opencv2/bgsegm.hpp" : YES (cached)
Has header "opencv4/opencv2/calib3d.hpp" : YES (cached)
Has header "opencv4/opencv2/core.hpp" : YES (cached)
Has header "opencv4/opencv2/imgproc.hpp" : YES (cached)
Has header "opencv4/opencv2/objdetect.hpp" : YES (cached)
Has header "opencv4/opencv2/opencv.hpp" : YES (cached)
Has header "opencv4/opencv2/video.hpp" : YES (cached)
which is great.
finally I am using:
lala = executable('lala','lala.cpp',
c_args : args,
include_directories : [includes_lala],
dependencies : [some_deps,cv2],
cpp_args : ['-g','-ggdb'],
link_with : some_lib )
but I am getting the next following error:
In file included from ../src/lala.cpp:1:
../include/lala.hpp:16:10: fatal error: opencv2/opencv.hpp: No such file or directory
16 | #include "opencv2/opencv.hpp"
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
I didn't find any solution. thanks!