Ubuntu 11.04 and OpenCV 2.3 highgui link error

After updating from Ubuntu 10.04 Lucid Lynx where I had every OpenCV projects working I got a strange error when I tried to use any code that used highgui on Ubuntu 11.04 Natty.

So if you see something like this:

:: warning: libavutil.so.49, needed by /usr/local/lib/libhighgui.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libhighgui.so:: error: undefined reference to `av_rescale_q@LIBAVUTIL_49′
/usr/local/lib/libhighgui.so:: error: undefined reference to `av_freep@LIBAVUTIL_49′
/usr/local/lib/libhighgui.so:: error: undefined reference to `av_malloc@LIBAVUTIL_49′
/usr/local/lib/libhighgui.so:: error: undefined reference to `av_free@LIBAVUTIL_49′
/usr/local/lib/libhighgui.so:: error: undefined reference to `av_sub_q@LIBAVUTIL_49′
:: error: collect2: ld returned 1 exit status

or for the visual types: (click to enlarge)

Qt Creator screenshot
Qt Creator screenshot

Probably you will get to a point where you think you are smarter then your system and type “sudo apt-get install libavutil49”. It will fail since this package is not recommended for Ubuntu 11.04 because it has the newer libavutil50. The solution is quite simple: download the package for Lucid from the ubuntu archives and install it.
Direct link to download page of this package: libavutil49 I38 package

When I was googling this problem I came through a http://stackoverflow.com/questions/5991313/error-while-building-opencv-examples-on-ubuntu which led me here.

Stay tuned!

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s