[Ffmpeg-devel] FFMpeg as shared library

Michel Bardiaux mbardiaux
Mon Jun 20 18:48:43 CEST 2005


Francesco Comi wrote:
> I wrote a small program that makes use of ffmpeg libavcodec and libavformat.
> 
> I compiled ffmpeg with
> 
> ./configure --enable-shared
> make lib
> make installlib
> 
> but when I compile my program I get an executable around 8-9 MB in
> size. If I compile ffmpeg with --disable-shared I get the same size
> for my program.
> 
> I compile my prog with this flags: -lavcodec -lavformat
> 
> How can I solve this? do I have to compile ffmpeg with some other flag?
> 
> Thanks.
> Francesco
> 
installlib installs the static libraries but not the shared libraries. 
Hence your later links are against the installed static libs.

Looking inside libavcodec/Makefile shows that you should use 'make 
install' (also remove the installed .a by hand!)

BTW, IMHO the behavior of configure and the installation rules is rather 
obfuscated. Using --enable-static or --disable-static does not produce 
any message, but has aboslutely no effect: the static libraries are 
*always* generated; 'make installlib' installs them, regardless of the 
enabling of shared; 'make install' installs the shared iff shared is 
enabled. Wouldnt it be better if 'shared' and 'static' were handled in a 
more symmetrical way?

-- 
Michel Bardiaux
Peaktime Belgium S.A.  Bd. du Souverain, 191  B-1160 Bruxelles
Tel : +32 2 790.29.41





More information about the ffmpeg-devel mailing list