<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><span style="font-size: 12pt;">> Date: Mon, 6 May 2013 09:18:58 -0400</span><br><div>> From: dribas@cenatav.co.cu<br>> To: libav-user@ffmpeg.org<br>> Subject: Re: [Libav-user] compiling ffmpeg with -fPIC<br>> <br>> 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:<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>> <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:<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>> I dont know wish is the problem with ffmpeg and -fPIC...<br><br></div><div>Hello, I'm new to the list.</div><div><br></div><div>If you want to link objects in a static library into a shared library, I think you need to compile the static library using -mcmode=large. As .so can be loaded at an address above 4gig, 32-bit code pointers don't work. The linker can neither create 64-bit relocations from 32-bit relocations or change function calls from non-PIC to PIC. So it throws an error.</div><div><font face="Courier New, Courier, Fixed" size="2"><br></font></div><div>Someone correct me if I'm wrong.</div>                                    </div></body>
</html>