安装Pangolin出现错误:
[ 4%] Linking CXX shared library libpangolin.so
/usr/bin/ld: /usr/local/lib/libswscale.a(swscale.o): relocation R_X86_64_PC32 against symbol `ff_M24A’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: 最后的链结失败: 错误的值
collect2: error: ld returned 1 exit status
src/CMakeFiles/pangolin.dir/build.make:1448: recipe for target ‘src/libpangolin.so’ failed
make[2]: *** [src/libpangolin.so] Error 1
CMakeFiles/Makefile2:497: recipe for target ‘src/CMakeFiles/pangolin.dir/all’ failed
make[1]: *** [src/CMakeFiles/pangolin.dir/all] Error 2
Makefile:155: recipe for target ‘all’ failed
make: *** [all] Error
解决办法:
下载:https://github.com/FFmpeg/FFmpeg/releases/tag/n3.4.8
安装ffmpeg 3.4.8
参考链接:
https://blog.csdn.net/qq_34607973/article/details/121963340?ops_request_misc=&request_id=&biz_id=102&utm_term=ubuntu%20ffmpeg%E5%AE%89%E8%A3%85&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduweb~default-1-121963340.nonecase&spm=1018.2226.3001.4187
注意:./configure 最后 加上–enable-shared --arch=x86_64
ffmpeg -version
删除pangolin下的build
rm -rf build
在CMAKELIST.txt 加入
add_compile_options(-fPIC)
重新编译
其他参考文档:
https://www.cnblogs.com/GengMingYan/p/14800319.html