[FFmpeg-devel] Binary compatibility for MinGW generated dlls
Mon May 14 16:39:55 CEST 2007
2007/5/14, Steve Lhomme <slhomme at corecodec.com>:
> Panagiotis Issaris wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > Hi,
> > Reimar D?ffinger wrote:
> >> Hello,
> >> On Mon, May 14, 2007 at 03:01:15PM +0200, Panagiotis Issaris wrote:
> >>> Currently, when building new versions of libavcodec using MinGW, the
> >>> generated dlls cannot replace the old ones without relinking the
> >>> application.
> >>> This is because the compiler generates the .def files, which contain all
> >>> public symbols. GCC sorts these alphabetically and numbers them
> >>> likewise. This means that if a symbol is added which is alphabetically
> >>> not situated after all other preexisting symbols, the library will lose
> >>> binary compatibility.
> >> [...]
> >>> PS: I am not very experienced in Windows related stuff, so, I might have
> >>> overlooked other simpler or better solutions...
> >> Can't you instruct the compiler to link only against the function names,
> >> not the numbers?
> >> At least when getting the function address dlopen-like you can choose if
> >> you want to specify a function name or a number...
> > Yes, I think that would be the simplest solution, but I think that
> > requires using dllexport markings for all API functions. And, if I
> > recall correctly, this was recently suggested by someone, but I think
> > people strongly disliked it... I am not sure though, I am currently
> > rereading the ml-archives to see what was said on that topic.
> Usually you generate the .dll with MinGW and then a .lib that you can
> use in MSVC (for MSVC users...). The problem is that this .lib
> references the .dll by the reference IDs and not the reference names.
> The other solution is to use LoadLibrary and GetProcHandle manually with
> the names. But that's an ugly solution.
To generate a .lib what you need only is a .def. If the .def doesn't
contain ordinals then the .lib can't possibly reference symbols by
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6
More information about the ffmpeg-devel