c - compile the examples of ffmpeg in C99 get wrong info -


i can run "make examples" using ffmpeg build environment .o files. cannot compile using c99. operating system use ubuntu 14.04 , configure ffmpeg following installation of ffmpeg-2.8.5 in linux, installing without error.

here detail(demuxing_decoding demuxing_decoding.c in ffmpeg_souce_folder/doc/examples):

 c99 -o demuxing_decoding demuxing_decoding.c -lavdevice -lavformat -lavcodec -lavfilter  -lavutil -lswresample -lswscale -lz -lbz2 
demuxing_decoding.c: in function ‘main’: demuxing_decoding.c:326:9: warning: ‘avcodec_alloc_frame’ deprecated (declared @ /usr/include/libavcodec/avcodec.h:3927) [-wdeprecated-declarations]          frame = avcodec_alloc_frame();          ^ demuxing_decoding.c:406:9: warning: ‘avcodec_free_frame’ deprecated (declared @ /usr/include/libavcodec/avcodec.h:3952) [-wdeprecated-declarations]          avcodec_free_frame(&frame);          ^ /tmp/ccgeq0zc.o: in function `decode_packet': demuxing_decoding.c:(.text+0x561): undefined reference `av_frame_unref' /tmp/ccgeq0zc.o: in function `open_codec_context': demuxing_decoding.c:(.text+0x5f4): undefined reference `av_get_media_type_string' demuxing_decoding.c:(.text+0x66c): undefined reference `av_get_media_type_string' demuxing_decoding.c:(.text+0x6df): undefined reference `av_get_media_type_string' /tmp/ccgeq0zc.o: in function `main': demuxing_decoding.c:(.text+0xcc1): undefined reference `av_frame_alloc' demuxing_decoding.c:(.text+0x1082): undefined reference `av_frame_free' collect2: error: ld returned 1 exit status 

i don't wrong...i've got stuck 2 days...needing help. lot!

i figure out problem. before rebuilt ffmpeg used apt-get install ffmpeg. using sudo apt-get remove ffmpeg remove not enough, run command sudo apt-get remove libavutil-dev libavutil-extra-51 additionally. after that, rebuild ffmpeg. fine~


Comments