I get this error when attempting to compile ffmpeg on a 64bit CentOS machine.
Here are my ./configure options:
./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
I get the following error when compiling the source:
/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
How do I get around this error, and get libvpx up and running with the latest ffmpeg on my 64-bit CentOS box?
Try
To add the flag that the error mentions is missing.
(And the question is...?)
Shared libraries must be composed of PIC object code, but ffmpeg failed to do so.
I had this problem in MythTV build with libx264.a
I downloaded and built as Saheed suggested.
The only thing is that /usr/local/lib/libx264.a was not changed when I did "make install". I had to do "make install-lib-static"
Since you configured FFMPEG with "--enable-shared", you also need to configure some of it's other libraries with "--enable-shared" also, and they must all use the same setting.
This error message is basically telling you to compile libvpx again with "--enable-shared" added to the configure command, then try compiling FFMPEG again (also configured with "--enable-shared"). Chances are that you will then get the same error but it will say "libx264" or "libmp3lame" instead of "libvpx", so you will also need to recompile those libs with "--enable-shared" in the configure command.
I got a similar error while compiling ffmpeg on an x86_64 machine running Oracle Linux 6.3. Oracle Linux is based on Red Hat and is thus similar to CentOS in the original question.
configure:
make:
In my case, this answer, although partly specific to Ubuntu, shed more light on the underlying issue with respect to x86_64 systems in general:
The fix was to ensure the x264 sources which I originally compiled using the "--enable-static" flag with configure (which generated "/usr/local/lib/libx264.a") was re-compiled using the "--enable-shared" flag which generates the correct target of "/usr/local/lib/libx264.so":
Did you compile your libvpx with
--shared
and-fPIC
so it generatedlibvpx.so*
?If not, you can try comment #6 and #7 in this issue.