[FFmpeg-devel] ffmpeg static library linking issue

Clément Bœsch ubitux at gmail.com
Mon Feb 6 13:44:02 CET 2012


On Mon, Feb 06, 2012 at 06:08:07PM +0530, yuvaraj r wrote:
> 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.
> 

This is a user question, or eventually libav-api one.

> 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
> 

Looks like the old deprecated API, which now leads to compilation errors
since the last bump. Look at doc/APIChanges and update your code.

Please do not reply here if you have more questions.

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120206/f6959c8c/attachment.asc>


More information about the ffmpeg-devel mailing list