OpenCV make失败 - "用-fPIC重新编译"

Rob*_*tez 7 ubuntu opencv

我在Ubuntu 13.10上安装了一些OpenCV安装,看起来有点不高兴.我已经完成了一些版本和安装方法,当我去"制造"或"制造-j4"制造卡车时,直到

/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
make[2]: *** [lib/libopencv_videoio.so.3.0.0] Error 1
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make: *** [all] Error 2
Run Code Online (Sandbox Code Playgroud)

任何帮助表示赞赏.再次感谢罗伯特.

D. *_*Hot 20

在启用了FFMPEG的Ubuntu 14.04上编译opencv3 alpha时遇到了同样的问题.我的FFMPEG是编译的git版本 ./configure make make install

我不得不重新编译FFMPEG ./configure --enable-nonfree --enable-pic --enable-shared

这对我来说就是诀窍,在那之后opencv3编译得很好.