I have a problem using OpenCV 4.1.2 in C++. I have this CMakelists.txt:
cmake_minimum_required(VERSION 2.8.12)
project( Barcode-cpp )
find_package( OpenCV REQUIRED )
add_compile_options(-std=c++11)
add_library( src
src/VideoVeed.h
src/VideoVeed.cpp
)
add_executable( program
program/main.cpp
)
target_link_libraries( program
src
${OpenCV_LIBS}
)
As you can see I have two folders with source code:
programcontainsmain.cppsrccontainsVideoVeed.h&VideoVeed.cpp
When I include OpenCV in main.cpp like this: <opencv2/opencv.hpp>, it works fine. But when I include OpenCV (the same way) it gives the error fatal error: 'opencv2/opencv.hpp' file not found.
I think I'm doing something wrong in my CMakelists.txt, but I can't figure out what exactly.
I hope someone is able to help me. Thanks in advance!