donglingsai2880 2013-12-15 16:25
浏览 47

自定义OpenCV安装问题[LINUX]

Just installed OpenCV 2.4.7 manually in a custom dir on my hosted CentOS 6.4 box. However, when I now try to "./configure" a program called OpenCV-for-PHP that depends on the OpenCV library, it doesn't recognize this new version and still automatically refers to the "old" OpenCV installation (version 2.0.0) that was installed through yum.

The question is: what do I have to set in order to make OpenCV in my custom directory the actively used OpenCV, that will be used during the ./configure stage? (instead of the one it looks up now, which was installed through yum) I've tried:

 [root@srv]# export LD_LIBRARY_PATH="/home/userhome/opencv/opencv-2.4.7/build/lib"
 [root@srv]# export PKG_CONFIG_PATH="/home/userhome/opencv/opencv-2.4.7/build/lib"
 [root@srv]# export PATH=/home/userhome/opencv/opencv-2.4.7/build/lib:$PATH

None of these seem to do the trick, however. pkg-config also still displays the old version after adding these vars.

 [root@srv]# pkg-config --modversion opencv
 2.0.0
 [root@srv]# 

Running "./configure" still displays the same dreaded message and exits prematurely:

 [root@srv1 OpenCV-for-PHP]# ./configure
 (...)
 checking for pkg-config... found
 checking for opencv... too old
 configure: error: Ooops ! You need at least opencv 2.1.0

Maybe it is possible to feed a specific parameter into the ./configure with a value set to my custom OpenCV install dir? (ie. ./configure --opencvpath=/home/usern/opencv/lib/)

All suggestions that might fix this issue are welcome!

  • 写回答

1条回答 默认 最新

  • doukun8944 2013-12-16 11:58
    关注

    PKG_CONFIG_PATH was pointing to the wrong directory. This var has to point to the pkg-config dir containing .pc files, ie. in our server's case "/usr/local/lib/pkgconfig".

    By opening the .pc file for OpenCV residing in the aforementioned directory it showed to be still pointing to the old installation. Simply change the value here to the custom path you've installed OpenCV in.

    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘