<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 6, 2013 at 6:18 AM, Dayana <span dir="ltr"><<a href="mailto:dribas@cenatav.co.cu" target="_blank">dribas@cenatav.co.cu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Gavin!!<br>
<br>
I set<br>
<br>
-shared -Wl,-Bsymbolic<br>
<br>
in the linker flags of my library, that depends of libavcodec, libavutil, libavformat...<br>
<br>
However when Im going to call av_register_all(); I get the same error:<div class="im"><br>
/usr/local/lib/libavcodec.a(<u></u>lpc_mmx.o): relocation R_X86_64_PC32 against<br>
symbol `ff_pd_1' can not be used when making a shared object; recompile<br>
with -fPIC<br>
<br></div>
///////<br>
<br>
I think that I have to set the flag -fPIC for compiling the libavcodec, libavutil, libavformat, so I added: enable pic , in the configure file of the ffmpeg project:<br>
<br>
# OS specific<br>
case $target_os in<br>
linux)<br>
        add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600<br>
        enable pic<br>
        enable dv1394<br>
<br>
<br>
Therefore when ffmpeg is compiled, libavcodec, libavutil, libavformat were compiled with -fPIC.... then when should be ok If I want to use them in my libx.so ... but It is not, I have the same error:<div class="im"><br>
<br>
/usr/local/lib/libavcodec.a(<u></u>lpc_mmx.o): relocation R_X86_64_PC32 against<br>
symbol `ff_pd_1' can not be used when making a shared object; recompile<br>
with -fPIC<br>
<br>
<br></div>
I dont know wish is the problem with ffmpeg and -fPIC...<div class="im"><br>
<br>
  <br>
<br></div></blockquote><div><br><br>I am a little confused, do you get this error when you are trying to use
 libavcodec.a into another of your projects or during compilation of 
libavcodec itself? In the latter case why are you building a static 
library (i.e. libavcodec.a instead of a libavcodec.so ) ? You need to 
build libavcodec as a shared object library by specifying 
--enable-shared --disable-static  or something to that effect<br><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
<br>
<br>
<br>
<br>
<br>
On 05/03/2013 06:32 AM, Gavin Kinsey wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On Wednesday 01 May 2013 15:41:48 Dayana wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi!!! Im developing an aplication using libavcodec, libavformat and<br>
libavutil. Im trying to make a shared library and for that I have to get<br>
libavs compiled with -fPIC ... I was trying to do it by setting<br>
--enable-pic in the configure file, however Im still have the same error:<br>
<br>
/usr/local/lib/libavcodec.a(<u></u>lpc_mmx.o): relocation R_X86_64_PC32 against<br>
symbol `ff_pd_1' can not be used when making a shared object; recompile<br>
with -fPIC<br>
</blockquote>
If you are trying to combine several ffmpeg libraries into a single shared<br>
library as I have seen some apps try to do then you need to use the<br>
following linker flag on the final library build step.<br>
<br>
-shared -Wl,-Bsymbolic<br>
<br>
</blockquote>
<br></div><div class=""><div class="h5">
______________________________<u></u>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/<u></u>listinfo/libav-user</a><br>
</div></div></blockquote></div><br></div></div>