Open duducode opened 4 years ago
The latest example code requires exactly OpenCV version 3.0.0 installed, if not, compiling will most probably end up with CMake errors similar to what follows:
Could not find a configuration file for package "OpenCV" that is compatible
with requested version "3.0.0".
The following configuration files were considered but not accepted:
/Users/nling/opencv/installation/OpenCV-master-debug/lib/cmake/opencv4/OpenCVConfig.cmake, version: 4.5.2
it means, the installed version is not matched with the required one. to fix this, you need to remove the specific OpenCV version or change it to the same version as installed on the dev machine.
# ./example/CMakeLists.txt
find_package(OpenCV REQUIRED COMPONENTS core imgcodecs imgproc highgui)
or
find_package(OpenCV 4.5.2 REQUIRED COMPONENTS core imgcodecs imgproc highgui)
Btw, if libomp
is not installed on MacOS, OpenMP related error will arise,
(base) ➜ build git:(master) ✗ cmake ..
-- CMAKE_INSTALL_PREFIX = /usr/local
-- Found OpenCV: /Users/nling/opencv/installation/OpenCV-master-debug (found version "4.5.2") found components: core imgcodecs imgproc highgui
CMake Error at /usr/local/lib/python3.9/site-packages/cmake/data/CMake.app/Contents/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
ran brew install libomp
fixed it, see MacOS, CMake and OpenMP for more details.
The following configuration files were considered but not accepted: