[FFmpeg-devel] Binary compatibility for MinGW generated dlls
Steve Lhomme
slhomme
Mon May 14 16:36:36 CEST 2007
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.
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slhomme.vcf
Type: text/x-vcard
Size: 124 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070514/6049a50d/attachment.vcf>
More information about the ffmpeg-devel
mailing list