<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">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>
<br>
I get the error: /usr/local/lib/libavcodec.a(lpc_mmx.o):
relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used
when making a shared object; recompile<br>
with -fPIC<br>
<br>
when Im trying to use the function av_register_all(), belonging to
libavcodec, in a library that I am programing (libmylibrary.so)<br>
<br>
For compiling libavcodec, I am doing ./configure, make, make
install in the directory of ffmpeg-0.11.1, wish contains
libavcodec, libavutil, etc... the result of this is libavcodec.a,
libavutil.a, etc...<br>
<br>
:)<br>
<br>
<br>
<br>
<br>
<br>
On 05/06/2013 10:56 AM, Ratin wrote:<br>
</div>
<blockquote
cite="mid:CAC0DzxyEt7qDxBznnX7cmcEz-BuAS4Numy7jL0FLCP7ANOAqzw@mail.gmail.com"
type="cite">
<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 moz-do-not-send="true"
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(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(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(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">
_______________________________________________<br>
Libav-user mailing list<br>
<a moz-do-not-send="true"
href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a moz-do-not-send="true"
href="http://ffmpeg.org/mailman/listinfo/libav-user"
target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Libav-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<a class="moz-txt-link-freetext" href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a>
</pre>
</blockquote>
<br>
</body>
</html>