2

I'm Trying to install OpenCV on Ubuntu 14.10 but i'm facing this error again and again :(

    /usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
    /usr/local/lib/libavcodec.a: error adding symbols: Bad value
    collect2: error: ld returned 1 exit status
    modules/highgui/CMakeFiles/opencv_highgui.dir/build.make:654: recipe for target 'lib/libopencv_highgui.so.2.4.9' failed
    make[2]: *** [lib/libopencv_highgui.so.2.4.9] Error 1
    CMakeFiles/Makefile2:1767: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failed
    make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
    Makefile:133: recipe for target 'all' failed
    make: *** [all] Error 2
AmrWinter
  • 21
  • 1
  • Installing on ubuntu 14.10 is a pain as the codecs have been changed so i would suggest using ubuntu 14.04 LTS in which opencv installs smoothly – iec2011007 Sep 06 '15 at 05:08

2 Answers2

0

Please provide the command history before you have encountered the error.

If calling make was the last thing before the error occured, you can try to call make CFLAGS="-fPIC" instead.

bubla
  • 963
  • 9
  • 10
0

Late to the party, but the issue is that FFMPEG is not compiled with position-independent code. Go to your FFMPEG directory and do

./configure --enable-nonfree --enable-pic --enable-shared

then redo the make, make install steps, and re-do the build of opencv.