[FFmpeg-user] Linking applications with FFmpeg

Misha Penkov misha.penkov at gmail.com
Thu Sep 20 12:37:26 CEST 2012


On 20 September 2012 19:22, Stefano Sabatini <stefasab at gmail.com> wrote:
> On date Thursday 2012-09-20 18:38:44 +0900, Misha Penkov encoded:
>> Hello,
>>
>> I'm maintaining the FFmpeg tutorials at
>> https://github.com/mpenkov/ffmpeg-tutorial.  Recently, I've noticed
>> that the tutorial does not link anymore:
>>
>> mpenkov at misha-desktop:~/git/ffmpeg-tutorial$ make bin/tutorial01.out
>> gcc -Wall -ggdb `pkg-config --cflags libavcodec libavformat libavutil
>> libswscale sdl` -c tutorial01.c -o obj/tutorial01.o
>> gcc -Wall -ggdb `pkg-config --cflags libavcodec libavformat libavutil
>> libswscale sdl` `pkg-config --cflags libavcodec libavformat libavutil
>> libswscale sdl` `pkg-config --libs libavcodec libavformat libavutil
>> libswscale sdl` -lm obj/tutorial01.o  -o bin/tutorial01.out
>
> Order of libraries specification matters. Try with:
> --libs libavformat libavcodec libswscale libavutil
>
> that is from the "biggest" to the "smaller".

Thank you for your suggestion.  Unfortunately, the end result is the same:

mpenkov at misha-desktop:~/git/ffmpeg-tutorial$ make bin/tutorial01.out
gcc -Wall -ggdb `pkg-config --cflags libavformat libavcodec libswscale
libavutil sdl` -c tutorial01.c -o obj/tutorial01.o
gcc -Wall -ggdb `pkg-config --cflags libavformat libavcodec libswscale
libavutil sdl` `pkg-config --libs libavformat libavcodec libswscale
libavutil sdl` -lm obj/tutorial01.o  -o bin/tutorial01.out
obj/tutorial01.o: In function `main':
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:70: undefined reference
to `av_register_all'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:73: undefined reference
to `avformat_open_input'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:77: undefined reference
to `avformat_find_stream_info'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:81: undefined reference
to `av_dump_format'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:97: undefined reference
to `avcodec_find_decoder'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:103: undefined
reference to `avcodec_open2'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:107: undefined
reference to `avcodec_alloc_frame'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:110: undefined
reference to `avcodec_alloc_frame'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:115: undefined
reference to `avpicture_get_size'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:117: undefined
reference to `av_malloc'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:120: undefined
reference to `sws_getContext'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:137: undefined
reference to `avpicture_fill'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:146: undefined
reference to `avcodec_decode_video2'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:152: undefined
reference to `sws_scale'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:171: undefined
reference to `av_free_packet'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:142: undefined
reference to `av_read_frame'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:175: undefined
reference to `av_free'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:176: undefined
reference to `av_free'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:179: undefined
reference to `av_free'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:182: undefined
reference to `avcodec_close'
/home/mpenkov/git/ffmpeg-tutorial/tutorial01.c:185: undefined
reference to `avformat_close_input'
collect2: ld returned 1 exit status
make: *** [bin/tutorial01.out] Error 1

Do you have any other ideas?

> --
> ffmpeg-user random tip #27
> Use the source Luke! If RTFM fails to help you, consider RTFS.
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user


More information about the ffmpeg-user mailing list