I encounterd this problem too, but I fix with below command.
"gcc xxx.c -o xxx -lavformat -lavcodec etc..."
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.
hope this help u.

2012/7/5 �橇⒅� <[email protected]>

> > Hi All,
> > I compiled the ffmpeg source to generate the static(.a foramt) libraries
>  in linux.
> > When i am linking the static libraries with my application,
> > i am getting undefined reference for many functions.
> > Even i tried with pkg-config.
> > Here command , what i tried
>
> I have encountered the same problem, I solved this problem but I don't
> know why it works.
>
> old test.c:
>
> #include <libavcodec/avcodec.h>
> #include <libavformat/avformat.h>
>
> int main()
> {
>         av_register_all();
>         return 0;
> }
>
>
> new test.c:
>
> #include <libavcodec/avcodec.h>
> #include <libavformat/avformat.h>
>
> int main()
> {
>         avcodec_register_all();
>         av_register_all();
>         return 0;
> }
> _______________________________________________
> Libav-user mailing list
> [email protected]
> http://ffmpeg.org/mailman/listinfo/libav-user
>
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to