Ubuntu16.04下SLAM环境配置时cmake出错-OpenCV NOT FOUND-解决方法

问题:

~/DBow3/build$ cmake ..
-- OpenCV ARCH: 
-- OpenCV RUNTIME: 
-- OpenCV STATIC: OFF
CMake Warning at /home/richard/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:49 (find_package)


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

    /home/richard/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!

See also "/home/richard/DBow3/build/CMakeFiles/CMakeOutput.log".

解决方法:

在OpenCVConfig.cmake中,将倒数第二行、倒数第三行修改如下:

  set(OpenCV_FOUND TRUE CACHE BOOL "" FORCE)
  set(OPENCV_FOUND TRUE CACHE BOOL "" FORCE)


cmake结果:

cmake ..
-- OpenCV ARCH: 
-- OpenCV RUNTIME: 
-- OpenCV STATIC: OFF
CMake Warning at /home/richard/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:49 (find_package)

-- -------------------------------------------------------------------------------
-- GNU COMPILER
-- -------------------------------------------------------------------------------
-- 
-- -------------------------------------------------------------------------------
-- General configuration for DBoW3 0.0.1
-- -------------------------------------------------------------------------------
-- 
    Compiler:/usr/bin/c++
-- C++ flags (Release):         -Wall -Wno-long-long -ffunction-sections  -fomit-frame-pointer -O3 -mmmx -msse -msse2 -msse3 -DNDEBUG  -std=c++11 
-- C++ flags (Debug):           -Wall -Wno-long-long -ffunction-sections -g3 -O0 -DDEBUG -D_DEBUG -W -Wextra -Wno-return-type  -std=c++11 
-- CMAKE_CXX_FLAGS:           -Wall -Wno-long-long -ffunction-sections
-- CMAKE_BINARY_DIR:         /home/richard/DBow3/build
-- 
-- CMAKE_SYSTEM_PROCESSOR = x86_64
-- CMAKE_INSTALL_PREFIX = /usr/local
-- CMAKE_BUILD_TYPE = Release
-- CMAKE_MODULE_PATH = /usr/local/lib/cmake/;/usr/lib/cmake
-- BUILD_UTILS= ON
-- BUILD_TESTS= 
-- OPENCV_DIR= /home/richard/opencv-3.1.0/cmake VERSION=
-- USE_CONTRIB= OFF
-- 
-- OpenCV_LIB_DIR=
-- CMAKE_INSTALL_PREFIX=/home/richard/DBow3/build
-- 
-- 
-- Change a value with: cmake -D<Variable>=<Value>
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/richard/DBow3/build

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值