Ask Your Question

Error compiling project with CMAKE

asked 2020-10-25 11:03:31 -0500

bko gravatar image

Hello, I want to compile my opencv project using cmake. Here is my CMakeLists.txt file

cmake_minimum_required(VERSION 2.8)
project( opencv_test )
set(OpenCV_DIR "C:/opencv/build/")

find_package(OpenCV REQUIRED)

include_directories( ${OpenCV_INCLUDE_DIRS} )
add_executable( opencv_test opencv_test.cpp )
target_link_libraries( opencv_test ${OpenCV_LIBS} )

However, I get the following error when calling find_package:

CMake Warning at C:/opencv/build/OpenCVConfig.cmake:176 (message):
  Found OpenCV Windows Pack but it has no binaries compatible with your

  You should manually point CMake variable OpenCV_DIR to your build of OpenCV
Call Stack (most recent call first):
  CMakeLists.txt:7 (find_package)

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


  but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be

Please help. Thank you very much,

Best regards, bko

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-10-28 12:45:36 -0500

bko gravatar image

Solved I used this tutorial to manually compile the OpenCV library. It seems that the precompiled library I downloaded from opencv website was not compatible with the visual studio 2017 version that I had (or something like that)

All the best, bko

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-10-25 11:03:31 -0500

Seen: 194 times

Last updated: Oct 28 '20