[vlc-devel] [patch] patch to configure.ac , solve avcodec-zlib link issue

cc nyvsld at gmail.com
Sat Oct 8 15:00:02 CEST 2005

this patch applys to:
vlc: snapshot20051003
(with ffmpeg: latest cvs)

when vlc configured without `--with-ffmpeg-tree',
and ffmpeg built without enabling zlib,
building vlc will failed with :

Making all in .
make[2]: Entering directory `/home/me/src/vlc-snapshot-20051002'
srcdir=. ./toolbox --update-version
gcc -Wsign-compare -Wall -I/home/me/include -pipe -L/home/me/lib -o
vlc src/vlc-vlc.o lib/libvlc.a ./modules/misc/memcpy/libmemcpymmx.a
./modules/misc/memcpy/libmemcpy3dn.a ./modules/mux/mpeg/libmux_ts.a
./modules/stream_out/libstream_out_switcher.a -L/home/me/lib -lrt
-lpthread -ldl -lm -L/home/me/lib -ldvbpsi -lavformat -lz -lavcodec
-lavutil -lm
/home/me/lib/libavcodec.a(lcl.o): In function `encode_frame':
/home/me/src/v/ffmpeg/libavcodec/lcl.c:578: undefined reference to
/home/me/src/v/ffmpeg/libavcodec/lcl.c:589: undefined reference to `deflate'

this is because libavcodec links to zlib,
and ld requires options ordered like this `-lavcodec -lz', not '-lz -lavcodec'.
this patch fixed this .
after apply, you 'll have to run
to regenerate `configure' script.
content listed below, also attached.

--- configure.ac.old    2005-10-03 04:50:18.000000000 +0800
+++ configure.ac        2005-10-08 20:18:49.000000000 +0800
@@ -2189,7 +2189,7 @@

       AC_CHECK_LIB(avcodec, avcodec_init, [
-        VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec])
+        VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec -lz])
         if test "${enable_sout}" != "no"; then
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.ac.diff
Type: text/x-patch
Size: 428 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20051008/23ff01c6/attachment.bin>

More information about the vlc-devel mailing list