[FFmpeg-devel] [PATCH] examples/decoding_encoding: remove unused variable "size"

François Revol revol at free.fr
Thu Apr 12 11:18:52 CEST 2012

On 12/04/2012 11:11, Clément Bœsch wrote:
> On Thu, Apr 12, 2012 at 10:14:30AM +0200, Nicolas George wrote:
>> Le quartidi 24 germinal, an CCXX, Clément Bœsch a écrit :
>>> Note: am I the only one to require an extra LDFLAGS=-lm to link this
>>> example?
>> Works for me. How do you try to link it exactly?
> [~/ffmpeg/doc/examples]% make decoding_encoding
> cc decoding_encoding.o -lavdevice -lavformat -lavfilter -lavcodec -lswscale -lavutil   -o decoding_encoding
> /usr/bin/ld: decoding_encoding.o: undefined reference to symbol 'sin@@GLIBC_2.2.5'
> /usr/bin/ld: note: 'sin@@GLIBC_2.2.5' is defined in DSO /lib/libm.so.6 so try adding it to the linker command line
> /lib/libm.so.6: could not read symbols: Invalid operation
> collect2: error: ld returned 1 exit status
> make: *** [decoding_encoding] Error 1
> [~/ffmpeg/doc/examples]% LDFLAGS=-lm make decoding_encoding
> cc decoding_encoding.o -lm -lavdevice -lavformat -lavfilter -lavcodec -lswscale -lavutil   -o decoding_encoding
> The libav* link against libm, but it works only for internal usage:
> 95:            samples[2*j] = (int)(sin(t) * 10000);
> This requires to link against -lm explicitely I guess (this is also true for
> the muxing example).
> And BTW, about that Makefile, I think LDLIBS would more appropriate that

Note libm does not exist everywhere, so do not hardcode it.
configure should already detect it, you just need to add the correct
variable to the LDFLAGS.


More information about the ffmpeg-devel mailing list