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

Clément Bœsch ubitux at gmail.com
Thu Apr 12 11:11:18 CEST 2012


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

-- 
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/20120412/812ef4ab/attachment.asc>


More information about the ffmpeg-devel mailing list