PacktPublishing / Learn-OpenCV-4-By-Building-Projects-Second-Edition

Learn OpenCV 4 By Building Projects, Second Edition, published by Packt
MIT License
383 stars 191 forks source link

CMake instructions incorrect #2

Closed ArifSohaib closed 5 years ago

ArifSohaib commented 5 years ago

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

damiles commented 5 years ago

@ArifSohaib. It's true, was a mistake on this instructions and pkgconfig was removed.

And of course it's required C++11 standard to work with.