一、问题详情
在ubuntu中使用CMake编译链接opencv库的程序时找不到opencv库,信息如下:
CMake Warning at //home/smallping/opencv-3.1.0/cmake/OpenCVConfig.cmake:166 (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:20 (find_package)
CMake Error at CMakeLists.txt:20 (find_package):
Found package configuration file:
//home/smallping/opencv-3.1.0/cmake/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
-- Configuring incomplete, errors occurred!
二、解决方法
经过查阅资料各种尝试,现已解决。主要问题在于库路径问题,
通过
sudo apt-get install cmake-qt-gui
cmake-gui
然后正确设置OpenCV_CONFIG_PATH and OpenCV_DIR。
OpenCV_CONFIG_PATH指向编译的OpenCVConfig.cmake
OpenCV_DIR指向编译的opencv目录(比如我编译opencv的时候,在cv源码下1、mkdir build. 2、cd build. 3、cmake, 那么路径就是build目录)

在Ubuntu环境下,使用CMake编译链接OpenCV库时遇到问题,CMake警告找到的OpenCV Windows Pack不兼容当前配置。解决方法包括安装cmake-qt-gui和cmake-gui,然后通过cmake-gui设置OpenCV_CONFIG_PATH和OpenCV_DIR,分别指向编译后的OpenCVConfig.cmake文件和OpenCV的build目录。
1954

被折叠的 条评论
为什么被折叠?



