1

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

Community
  • 1
  • 1
Yasser Souri
  • 1,967
  • 2
  • 19
  • 26

1 Answers1

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
SIFE
  • 5,567
  • 7
  • 32
  • 46
  • I have libavutil50 installed (I installed it with synaptic). but when I try "ls -l /usr/local/lib/libavutil.so*" I get nothing back – Yasser Souri May 13 '11 at 12:01
  • 1
    Try `ls -l /usr/lib/libavutil.so*`. – SIFE May 13 '11 at 12:05
  • I have this same error using OpenCV with Python 2.6. When I tried to soft link libavutil.so.50 to libavutil.so.49, I get this error from Python: import cv; ImportError: /usr/lib/libavutil.so.49: version `LIBAVUTIL_49' not found (required by /home/ely/OpenCV-2.2.0/lib/libopencv_highgui.so.2.2) Any ideas? ALSO: the apt-get suggestion for libavutil49 does not work. apt-get says that packaged is obsoleted, at least from Ubuntu 11.04. – ely Jun 16 '11 at 20:51
  • 3
    FYI: Figured this out. Needed to go to the packages.ubuntu.com site for Lucid, manually download the libavutil49 package and install with dpkg. Then things go back to normal. – ely Jun 16 '11 at 21:17