I encounterd this problem too, but I fix with below command.<div>"gcc xxx.c -o xxx -lavformat -lavcodec etc..."</div><div>if you get "undefined reference" error, you should use "grep" to find which xx.a file contains the implement of that function, then plus the command "-lxxx.a" in gcc.</div>
<div>hope this help u.<br><br><div class="gmail_quote">2012/7/5 …ÇÁ¢Ö¾ <span dir="ltr"><<a href="mailto:lichih@daiseki.com.tw" target="_blank">lichih@daiseki.com.tw</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> Hi All,<br>
> I compiled the ffmpeg source to generate the static(.a foramt) libraries  in linux.<br>
> When i am linking the static libraries with my application,<br>
> i am getting undefined reference for many functions.<br>
> Even i tried with pkg-config.<br>
> Here command , what i tried<br>
<br>
I have encountered the same problem, I solved this problem but I don't<br>
know why it works.<br>
<br>
old test.c:<br>
<br>
#include <libavcodec/avcodec.h><br>
#include <libavformat/avformat.h><br>
<br>
int main()<br>
{<br>
        av_register_all();<br>
        return 0;<br>
}<br>
<br>
<br>
new test.c:<br>
<br>
#include <libavcodec/avcodec.h><br>
#include <libavformat/avformat.h><br>
<br>
int main()<br>
{<br>
        avcodec_register_all();<br>
        av_register_all();<br>
        return 0;<br>
}<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</blockquote></div><br></div>