在ubuntu上构建OpenCV示例时出错 [英] Error while building OpenCV examples on ubuntu

查看:86
本文介绍了在ubuntu上构建OpenCV示例时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用本教程在ubuntu上构建OpenCV. 一切顺利,直到我尝试构建示例为止.当我这样做时:

I've used this tutorial to build OpenCV on ubuntu. Everything goes well until I try to build the examples. when I do this:

sh build_all.sh

sh build_all.sh

发生许多相同的错误:

编译tree_engine.cpp

compiling tree_engine.cpp

/usr/bin/ld: 警告:libavutil.so.49,需要 /usr/local/lib/libopencv_highgui.so, 找不到(尝试使用-rpath或 -rpath-link)

/usr/bin/ld: warning: libavutil.so.49, needed by /usr/local/lib/libopencv_highgui.so, not found (try using -rpath or -rpath-link)

对于每个示例,都会发生相同的错误. 代码可以编译,但是尝试运行已编译的代码将失败,并显示以下错误:

for each example the same error occurs. The code compiles but trying to run the compiled code will fail with error:

./tree_engine:加载时出错 共享库:libavutil.so.49: 无法打开共享对象文件:否 这样的文件或目录

./tree_engine: error while loading shared libraries: libavutil.so.49: cannot open shared object file: No such file or directory

我不知道这个libavutil是什么.

I have no idea what this libavutil is.

我使用ubuntu 10.10

I use ubuntu 10.10

推荐答案

可能是您使用了其他名称,所以请尝试以下操作:

May be you have it in different name, so try this:

ls -l /usr/local/lib/libavutil.so*

就我而言:

lrwxr-xr-x  1 root  wheel     20 Jan 17 00:30 /usr/local/lib/libavutil.so -> libavutil.so.50.15.1
lrwxr-xr-x  1 root  wheel     20 Jan 17 00:30 /usr/local/lib/libavutil.so.1 -> libavutil.so.50.15.1
-rwxr-xr-x  1 root  wheel  54352 Jan 17 00:30 /usr/local/lib/libavutil.so.50.15.1

以root身份输入:

ln -s /usr/local/lib/libavutil.so.50.15.1 /usr/local/lib/libavutil.so.49

如果您没有此库,则可以通过软件包管理器进行安装:

If you don't have this library, you can install via package manager:

apt-get install libavutil49

这篇关于在ubuntu上构建OpenCV示例时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆