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

原创 2018年04月15日 18:10:13

编译其他包时,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)貌似就是忽略错误的意思吧

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

若安装OpenCV测试时报错 CMake Warning at /home/e/OpenCV/cmake/OpenCVConfig.cmake:166 (message): Found Open...
  • ustczhang
  • ustczhang
  • 2018-01-10 19:57:59
  • 398

在CLoin下配置opencv的方法(最简方式)

笔者所用环境 Mac 10.11 + cLoin + brew + opencv 3.2 cLion这个IDE怎么安装就不赘述了。 安装brew。brew是一个安装软件的工具,ruby写的,我们通...
  • yu544324974
  • yu544324974
  • 2017-01-06 14:39:46
  • 601

ubuntu opencv报错

在配置完opencv之后,cmake,出现错误 .
  • qq_36130482
  • qq_36130482
  • 2017-10-25 09:58:11
  • 300

CLion中配置OpenCV环境问题

环境:CentOS 6.5 + CLion1.2 + OpenCV 2.4.9 修改CMakeLists.txt: 在project(YOUR_PROJECT_NAME)后面加入 FIND_PACK...
  • shenck1992
  • shenck1992
  • 2015-11-10 12:00:04
  • 7320

Ubuntu16.04+anaconda2+caffe+ssd+opencv3.1.0在编译caffe过程中的问题及解决方法 主要遇到三个问题,前两个是caffe在cmake过程中的问题,后一

Ubuntu16.04+anaconda2+caffe+ssd+opencv3.1.0在编译caffe过程中的问题及解决方法     主要遇到三个问题,前两个是caffe在cmake过程中的问题,后...
  • bengik
  • bengik
  • 2017-12-01 19:51:49
  • 482

Ubuntu14.04下Opencv2.4.13使用遇到的问题

装了双系统,所以想把工作尽量在Ubuntu下面完成。以前在Windows下面使用opencv,现在想在Ubuntu下用。 编写一个例子test.cpp:简单的显示图片 #include ...
  • poulang5786
  • poulang5786
  • 2017-12-30 12:14:48
  • 172

解决configure: error: libpng.(a|so) not found.

yum install libpng libpng-devel   # ln -s /usr/lib64/libjpeg.so /usr/lib/ # ln -s /usr/lib64/libpn...
  • alexdream
  • alexdream
  • 2012-03-29 19:07:01
  • 10652

Package OpenCV not found? Let’s Find It.

转载地址:http://prateekvjoshi.com/2013/10/18/package-opencv-not-found-lets-find-it/ OpenCV has been...
  • uhippo
  • uhippo
  • 2015-12-30 15:07:54
  • 4257

opencv-package 'eigen3' not found

参考资料 https://prateekvjoshi.com/2013/10/18/package-opencv-not-found-lets-find-it/
  • heroacool
  • heroacool
  • 2017-04-25 14:09:55
  • 554

编译VTK时Qt5_DIR-NOTFOUND的解决方法

编译VTK时Qt5_DIR-NOTFOUND的解决方法 在编译VTK时需要用到Qt,打开了Module_vtkGUISupportQt和Module_vtkViewsQt两个模块,用的是Qt5。...
  • loyirui
  • loyirui
  • 2016-01-28 13:43:01
  • 3985
收藏助手
不良信息举报
您举报文章:but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND.
举报原因:
原因补充:

(最多只允许输入30个字)