Cmake编译C++程序报错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.

解决办法

在CMakeLists.txt中使用set(OpenCV_DIR "D:/opencv/build/x64/vc15/lib")  设置OpenCV目录,

如果根据网络上的文章设置为set(OpenCV_DIR "D:/opencv/build") 就会报标题中的错误,需要配置成opencv/build/x64/vc15/lib这个目录。

更改后的配置如下:

set(OpenCV_DIR "D:/opencv/build/x64/vc15/lib")

find_package( OpenCV REQUIRED )

posted @ 2019-12-25 15:43  凉L  阅读(7424)  评论(3编辑  收藏  举报