Ask Your Question
0

Error compiling project with CMAKE

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

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
  configuration.

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


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

    C:/opencv/build/OpenCVConfig.cmake

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

Please help. Thank you very much,

Best regards, bko

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

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

bko gravatar image

Solved I used this tutorial https://www.youtube.com/watch?v=By-PKbWDZNk 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

Stats

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

Seen: 4,982 times

Last updated: Oct 28 '20