Found OpenCV Windows Pack but it has no binaries compatible with your configuration

i am getting below error while running
cmake . -G “MinGW Makefiles”
mingw32-make

error Text :
C:\opencv>cmake . -G “MinGW Makefiles”
– The C compiler identification is GNU 8.1.0
– The CXX compiler identification is GNU 8.1.0
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: C:/Program Files/CodeBlocks/MinGW/bin/gcc.exe - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: C:/Program Files/CodeBlocks/MinGW/bin/c++.exe - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– OpenCV ARCH: x64
– OpenCV RUNTIME: mingw
– OpenCV STATIC: OFF
CMake Warning at C:/Program Files/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:8 (find_package)

CMake Error at CMakeLists.txt:8 (find_package):
Found package configuration file:

C:/Program Files/opencv/build/OpenCVConfig.cmake

but it set OpenCV_FOUND to FALSE so package “OpenCV” is considered to be
NOT FOUND.

– Configuring incomplete, errors occurred!

below is my cmakelists.txt
cmake_minimum_required(VERSION 3.10)
project(OpenCV_cpp)

Specify the path to OpenCV if it’s not in the system’s search path

set(OpenCV_DIR “C:\Program Files\opencv\build”)

find_package(OpenCV REQUIRED)

if(OpenCV_FOUND)
message(STATUS “OpenCV found.”)
else()
message(FATAL_ERROR “OpenCV not found.”)
endif()

include_directories(${OpenCV_INCLUDE_DIRS})

add_executable(facedetect facedetect.cpp)
target_link_libraries(facedetect ${OpenCV_LIBS})

please advise.

Thanks

not officially supported.

the official “Windows Pack” provides binaries for MSVC, not for mingw.

Thanks for the reply.
Can I use minGW without makefile?
I meant command line for compiling and linking using minGW compiler?
Linking to opencv libs on windows
Please advise.

Thanks

again. if using mingw for a compiler, you must build your own. local libraries first

once you, ve build the libs.
for a simple, one file project, you can use some cmdline (like g++ myfile.cpp -I myincludes/opencv4/include -l opencv_core411 -o my.exe)

for now, please cleanup (or even delete) th build folder& start all over with cmake

gl !