[Libav-user] ffmpeg static library linking issue

yuvaraj r yuvaraj.tr at gmail.com
Tue Feb 7 11:40:06 CET 2012


#pkg-config --libs --cflags libavutil

      -I/usr/local/include -I/usr/local/include/ffmpeg
-L/usr/local/lib -lavutil

# pkg-config --libs --cflags libswscale

   -I/usr/local/include -I/usr/local/include/swscale
-I/usr/local/include/ffmpeg  -L/usr/local/lib -lswscale -lavutil

# pkg-config --libs --cflags libavcodec

     -I/usr/local/include -I/usr/local/include/ffmpeg
-L/usr/local/lib -lavcodec -lm -lz -ldl -lavutil
#pkg-config --libs --cflags libavformat

-I/usr/local/include -I/usr/local/include/ffmpeg  -L/usr/local/lib
-lavformat -lavcodec -lm -lz -ldl -lavutil

Could provide any example  regarding how to use ffpmpeg static libraries

Thanks

Yuvaraj


On Tue, Feb 7, 2012 at 3:52 PM, jan hölscher <jan.hoelscher at codergrid.de> wrote:
>
>
> 2012/2/7 yuvaraj r <yuvaraj.tr at gmail.com>
>>
>> C language
>>
>>
>> On Tue, Feb 7, 2012 at 3:20 PM, jan hölscher <jan.hoelscher at codergrid.de>
>> wrote:
>> > Is your Library written in "C" or in "C++"?
>> >
>> >
>> > 2012/2/7 yuvaraj r <yuvaraj.tr at gmail.com>
>> >>
>> >> 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
>> >>
>> >>
>> >> gcc -shared -Wl,-soname,librecorder.so.1 '-Wl,-rpath,lib'  -lpthread
>> >> -lXdamage -lXfixes -lXmu -lXi -lX11
>> >>
>> >> -L/home/peter/Desktop/screenrecorder/librecorder/src/../dependencies/lib
>> >>  -lavformat -lavcodec -lavutil -lswscale `pkg-config --libs --cflags
>> >> libavutil` `pkg-config --libs --cflags libswscale` `pkg-config --libs
>> >> --cflags libavcodec` `pkg-config --libs --cflags libavformat` -o
>> >> librecorder.so.1.1 init.o main_entry.o xtoffmpeg.o
>> >>
>> >>
>> >> It is generated the librecorder library. I have all dependency libs
>> >>
>> >> when executing ld command
>> >>
>> >> #ld librecorder.so.1.1
>> >>
>> >> librecorder.so.1: undefined reference to `av_new_stream'
>> >> librecorder.so.1: undefined reference to `av_read_packet'
>> >> librecorder.so.1: undefined reference to `avcodec_alloc_frame'
>> >> librecorder.so.1: undefined reference to `av_close_input_file'
>> >> librecorder.so.1: undefined reference to `audio_resample'
>> >> librecorder.so.1: undefined reference to `avcodec_find_encoder'
>> >> librecorder.so.1: undefined reference to `av_find_input_format'
>> >> librecorder.so.1: undefined reference to `avcodec_encode_audio'
>> >> librecorder.so.1: undefined reference to `dump_format'
>> >> librecorder.so.1: undefined reference to `av_open_input_file'
>> >> librecorder.so.1: undefined reference to `avcodec_find_decoder'
>> >> librecorder.so.1: undefined reference to `avcodec_close'
>> >> librecorder.so.1: undefined reference to `av_find_stream_info'
>> >> librecorder.so.1: undefined reference to `audio_resample_init'
>> >> librecorder.so.1: undefined reference to `avpicture_get_size'
>> >> librecorder.so.1: undefined reference to `av_register_all'
>> >> librecorder.so.1: undefined reference to `avcodec_decode_audio'
>> >> librecorder.so.1: undefined reference to `avcodec_open'
>> >> librecorder.so.1: undefined reference to `avcodec_encode_video'
>> >> librecorder.so.1: undefined reference to `av_destruct_packet_nofree'
>> >> librecorder.so.1: undefined reference to `avpicture_fill'
>> >> librecorder.so.1: undefined reference to `av_set_parameters'
>> >> librecorder.so.1: undefined reference to `av_alloc_format_c
>> >>
>> >> Now problem with static libraries.
>> >>
>> >>
>> >> #pkg-config --list-all | grep mpeg
>> >> libswscale                       libswscale - FFmpeg image rescaling
>> >> library
>> >> libavutil                        libavutil - FFmpeg utility library
>> >> libavformat                      libavformat - FFmpeg container format
>> >> library
>> >> libavcodec                       libavcodec - FFmpeg codec library
>> >>
>> >>
>> >> How do i solve this issue
>> >>
>> >>
>> >> Thanks
>> >>
>> >>
>> >> Yuvaraj R
>> >> _______________________________________________
>> >> Libav-user mailing list
>> >> Libav-user at ffmpeg.org
>> >> http://ffmpeg.org/mailman/listinfo/libav-user
>> >
>> >
>> >
>> >
>> > --
>> > Media Encoding Cluster,
>> > the first Open Source Cluster Encoding Solution
>> > for distributed Media Encoding.
>> >
>> >
>> > _______________________________________________
>> > Libav-user mailing list
>> > Libav-user at ffmpeg.org
>> > http://ffmpeg.org/mailman/listinfo/libav-user
>> >
>> _______________________________________________
>> Libav-user mailing list
>> Libav-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
> what output did you get when executing the
>
> pkg-config --libs --cflags libavutil
> pkg-config --libs --cflags libswscale
> pkg-config --libs --cflags libavcodec
> pkg-config --libs --cflags libavformat
>
> commands
> --
> Media Encoding Cluster,
> the first Open Source Cluster Encoding Solution
> for distributed Media Encoding.
>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>


More information about the Libav-user mailing list