ubuntu 14.04 编译opencv-3.4.2 报错: /usr/bin/ld: /usr/local/lib/libavformat.a(allformats.o): relocation

Posted dangxusheng

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ubuntu 14.04 编译opencv-3.4.2 报错: /usr/bin/ld: /usr/local/lib/libavformat.a(allformats.o): relocation 相关的知识,希望对你有一定的参考价值。

ubuntu 14.04 编译opencv-3.4.2 报错解决:

错误信息:
/usr/bin/ld: /usr/local/lib/libavformat.a(allformats.o): relocation R_X86_64_32 against `.bss‘ can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavformat.a: error adding symbols: 错误的值
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libopencv_videoio.so.3.4.2] 错误 1
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....

原因:ffmpeg未安装或配置不对

解决办法:
1 重新配置编译ffmpeg
2 重新配置编译opencv
******* 参考操作步骤:  https://blog.csdn.net/linuxsmallping/article/details/82968501

以上是关于ubuntu 14.04 编译opencv-3.4.2 报错: /usr/bin/ld: /usr/local/lib/libavformat.a(allformats.o): relocation 的主要内容,如果未能解决你的问题,请参考以下文章