当前位置:   article > 正文

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

opencv_dir-notfound

问题:

~/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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/292870
推荐阅读
相关标签
  

闽ICP备14008679号