0

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?

chronosynclastic
  • 1,585
  • 3
  • 19
  • 40
  • What's the result of "locate" for those libraries? [example](http://stackoverflow.com/questions/335928/ld-cannot-find-an-existing-library) – bjornruffians Aug 12 '15 at 14:49
  • Thanks. See the edit. By the way, I pointed `LD_LIBRARY_PATH` and `PKG_CONFIG_PATH` to one of those paths. – chronosynclastic Aug 12 '15 at 15:05
  • As long as the makefile can find the right libs, then you're okay having more than one version on your machine. Not sure if those are supposed to be static libraries or shared (.so) for the makefile to work (can look for -static flag in makefile). Also, 32-bit versus 64-bit library references could be an issue. – bjornruffians Aug 12 '15 at 15:47

0 Answers0