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

Derk-Jan Hartman hartman at videolan.org
Mon Oct 17 22:42:33 CEST 2005


On 08 okt 2005, at 15:00, cc wrote:

> 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 :
>

I'm confused here. You said you built ffmpeg without libz, but  
libavcodec is clearly linked to libz, otherwise it wouldn't complain  
about a missing symbol

DJ


>
> ``
> 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/video_chroma/libi420_rgb_mmx.a
> ./modules/video_chroma/libi422_yuy2_mmx.a
> ./modules/video_chroma/libi420_ymga_mmx.a
> ./modules/video_chroma/libi420_yuy2_mmx.a
> ./modules/misc/memcpy/libmemcpymmxext.a
> ./modules/misc/memcpy/libmemcpy3dn.a ./modules/mux/mpeg/libmux_ts.a
> ./modules/codec/ffmpeg/libffmpeg.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
> `deflateReset'
> /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
>   autoreconf
> 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_BUILTINS([ffmpeg])
> -        VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec])
> +        VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec -lz])
>          if test "${enable_sout}" != "no"; then
>              VLC_ADD_BUILTINS([stream_out_switcher])
>          fi],
>
> <configure.ac.diff>
>

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list