I’m relatively new to CMAKE and OpenCV in c++, and can’t seem to get it working.
- My CMAKE –version = 3.28.2.
- I added the x64 bin and lib from OpenCV to my path.
- I used this command to create the CMake project: cmake -G
“MinGW Makefiles” ..
And this is the CMake file, simple for testing:
cmake_minimum_required(VERSION 3.0)
project(OpenCVTest)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
add_executable(OpenCVTest main.cpp)
target_link_libraries(OpenCVTest ${OpenCV_LIBS})
Now, when I try to build. I receive this error:
-- OpenCV ARCH: x64
-- OpenCV RUNTIME: mingw
-- OpenCV STATIC: OFF
CMake Warning at C:/OpenCV/opencv/build/OpenCVConfig.cmake:190 (message):
Found OpenCV Windows Pack but it has no binaries compatible with your
configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
CMakeLists.txt:5 (find_package)
CMake Error at CMakeLists.txt:5 (find_package):
Found package configuration file:
C:/OpenCV/opencv/build/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
-- Configuring incomplete, errors occurred!
mingw32-make: *** [Makefile:178: cmake_check_build_system] Error 1
And I just don’t understand how to fix it. I have seen and tried some solutions online which I didn’t understand either.
Sorry for the noob question, I’m trying to understand what is happening, so I can figure it out by myself next time, but right now I need some help