There seems to be a problem with the included cmake instructions.
According to:
https://github.com/opencv/opencv/issues/13154 OpenCV4 no longer builds the pkgconfig file.
I was able to use the method described here to make the file but it doesn't work and building the example program in chapter 1 returns several errors.
On the other hand if I into samples/c++/example_cmake and use that CMake file using cmake . and then make, it compiles and runs fine.
Another issue might be due to the absence of set(CMAKE_CXX_STANDARD 11) and set(CMAKE_CXX_STANDARD_REQUIRED TRUE) in the book's CMake as OpenCV4 requires C++11
There seems to be a problem with the included cmake instructions. According to: https://github.com/opencv/opencv/issues/13154 OpenCV4 no longer builds the pkgconfig file. I was able to use the method described here to make the file but it doesn't work and building the example program in chapter 1 returns several errors. On the other hand if I into samples/c++/example_cmake and use that CMake file using
cmake .
and thenmake
, it compiles and runs fine. Another issue might be due to the absence ofset(CMAKE_CXX_STANDARD 11)
andset(CMAKE_CXX_STANDARD_REQUIRED TRUE)
in the book's CMake as OpenCV4 requires C++11