Ask Your Question
0

Error compiling project with CMAKE

asked Oct 25 '0

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

Preview: (hide)

1 answer

Sort by » oldest newest most voted
0

answered Oct 28 '0

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

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Oct 25 '0

Seen: 5,651 times

Last updated: Oct 28 '20