【发布时间】:2012-03-19 08:20:42
【问题描述】:
尝试在 64 位 CentOS 机器上编译 ffmpeg 时出现此错误。
这是我的 ./configure 选项:
./configure --enable-shared --enable-gpl --enable-nonfree --enable-postproc --enable-swscale --enable-pthreads --enable-libx264 --enable-libxvid --enable-libvorbis --enable-libfaac --enable-libmp3lame --enable-libvpx
make
编译源码时出现如下错误:
/usr/bin/ld: /usr/local/lib/libvpx.a(vpx_codec.c.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/libvpx.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libavcodec/libavcodec.so.54] Error 1
如何解决这个错误,并在我的 64 位 CentOS 机器上使用最新的 ffmpeg 启动并运行 libvpx?
【问题讨论】:
-
有时当你运行 -fPIC 时,它会为某些子目标文件再次抛出此错误。只需备份该目标文件并再次运行 make 即可。例子。您正在运行 TotalSum.cpp,它引用了另一个文件 CalculateSum.o。现在,错误出现在CalculateSum.o 上。因此,还要备份CalculateSum.o 并运行-fPIC。错误会消失。