Error while building OpenCV examples on ubuntu

ⅰ亾dé卋堺 提交于 2020-07-09 11:44:10

问题


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

many of the same error occurs:

compiling tree_engine.cpp

/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: error while loading shared libraries: libavutil.so.49: cannot open shared object file: No such file or directory

I have no idea what this libavutil is.

I use ubuntu 10.10


回答1:


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

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

In my case:

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

As root type this:

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


来源:https://stackoverflow.com/questions/5991313/error-while-building-opencv-examples-on-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!