FFMpeg 2.7.2 and all necessary libav*
libraries are installed on my Ubuntu 14.04 machine. However, when I try to install OpenCV 2.4.11 (with FFMpeg enabled), I get the following error:
/usr/bin/ld: cannot find -lavcodec
/usr/bin/ld: cannot find -lswresample
/usr/bin/ld: cannot find -lavutil
/usr/bin/ld: cannot find -lavformat
/usr/bin/ld: cannot find -lavcodec
/usr/bin/ld: cannot find -lswresample
/usr/bin/ld: cannot find -lavutil
/usr/bin/ld: cannot find -lavformat
collect2: error: ld returned 1 exit status
make[2]: *** [bin/opencv_annotation] Error 1
make[1]: *** [apps/annotation/CMakeFiles/opencv_annotation.dir/all] Error 2
make: *** [all] Error 2
I already tried pointing LD_LIBRARY_PATH
and PKG_CONFIG_PATH
to the locations which contain the FFmpeg libraries. I also tried with OpenCV 3.0 and obtained the same error.
It seems that there is some kind of incompatibility between these versions of FFMpeg and OpenCV. Is there a workaround for this?
EDIT:
For example locate libavcodec.a
outputs:
/home/guel/cvpr2014/bin/dependencies/ffmpeg-2.4/libavcodec/libavcodec.a
/home/guel/cvpr2014/bin/dependencies/lib/libavcodec.a
/home/guel/cvpr2014/bin/dependencies/opencv-2.4.9/3rdparty/lib/libavcodec.a
/home/guel/ffmpeg_build/lib/libavcodec.a
/home/guel/git/ffmpeg/libavcodec/libavcodec.a
/home/guel/mplayer/ffmpeg/libavcodec/libavcodec.a
/home/guel/projects/mpegflow/dependencies/opencv-2.4.11/3rdparty/lib/libavcodec.a
So, I have it in multiple places. Is that bad?