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

Trent Piepho xyzzy
Sat May 12 01:36:36 CEST 2007


On Sat, 12 May 2007, 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?

Ulrich Drepper has a great paper on how to write DSOs that goes into this:
http://people.redhat.com/drepper/dsohowto.pdf

The most obvious is just to make things static when you can and try to
organize your code to make as much static as you can.

gcc has a visibility attribute that you can assign to functions and globals to
make them library-wide static or non-library wide static.  There is also the
gcc -fvisibility option that changes the default.  So you can make the default
hidden and override the symbols you want your library to export, or do it the
other way around.

There is another method, specifying a export map to the linker, which can use
wildcards I believe.  This doesn't produce code as efficient as controlling
visibility, since it's done at the linking stage vs the compiling stage.




More information about the ffmpeg-devel mailing list