[FFmpeg-devel] Why 'You can only build one library type at once on MinGW'?

Uoti Urpala uoti.urpala
Sat May 12 02:13:00 CEST 2007

On Sat, 2007-05-12 at 01:15 +0200, Michael Niedermayer wrote:
> and to get this totally off topic disscussion a little back to ffmpeg, 
> i wish i could get gcc to make all symbols which arent in a specific set
> of headers "library-wide static" anyone knows a simple and clean trick
> to do that?

"-fvisibility=hidden" makes all symbol definitions generated hidden by
default, so that they do not appear in the external API. You can
explicitly mark some as public by using
'__attribute__((visibility("default")))', or using a #pragma to change
the default for some part of a file.

That takes care of the visibility of generated symbols and thus of the
external API part. However it's not enough for the code efficiency part.
Because the code will include external headers too -fvisibility can not
change the default for extern symbol _declarations_ (otherwise symbols
declared within say "#include <stdlib.h>" would be assumed to be in the
same library). So to make the code access symbols defined in other files
of the same library more efficiently you need to mark the visibility in
internal headers too to distinguish them from headers declaring symbols
that will be in external libraries. Again you can do this by either
using a per-symbol attribute or using a #pragma (the #pragma changes the
default for both definitions and extern declarations).

More information about the ffmpeg-devel mailing list