but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND.

编译其他包时,opencv 错误


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

    /usr/local/opencv-2.4.9/cmake/OpenCVConfig.cmake

  but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
  NOT FOUND.

解决办法
重新编译opencv

mkdir build
cd build

重点来了

sudo cmake -D BUILD_DOCS=ON -D WITH_QT=ON -D WITH_XINE=ON -D WITH_OPENGL=ON -D WITH_TBB=ON -D WITH_OPENNI=ON -D BUILD_EXAMPLES=ON -D WITH_OPENCL=ON -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv-2.4 -D CUDA_GENERATION=Kepler ..

代替cmake

sudo make -j4
sudo make install

Add to the file /etc/ld.so.conf:

/usr/local/opencv-2.4.9/lib

Then:

sudo ldconfig

Add the paths to OpenCV to your .bashrc, for me was:

source /opt/ros/hydro/setup.bash
CMAKE_PREFIX_PATH=/usr/local/opencv-2.4.9:$CMAKE_PREFIX_PATH
CPATH=/usr/local/opencv-2.4.9/include:$CPATH
LD_LIBRARY_PATH=/usr/local/opencv-2.4.9/lib:$LD_LIBRARY_PATH ...

//??///?????还没解决
********************************************************************************************************************************************************************************************************************************************************## 正确办法分割线 ##**********************************************

找到/usr/local/opencv-2.4.9/cmake/OpenCVConfig.cmake
在OpenCVConfig.cmake的最后加一句

set(OpenCV_FOUND 1)  

应该是因为里面有错误检查, set(OpenCV_FOUND 1)貌似就是忽略错误的意思吧

阅读更多
个人分类: linux使用
上一篇在ubuntu16.04安装 g2o
下一篇ubuntu装机基本
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭