[Ffmpeg-devel] Win32 unresolved external symbol

Martin Boehme boehme
Wed Sep 7 17:02:51 CEST 2005


Michel Bardiaux wrote:
> Martin Boehme wrote:
>> Michel Bardiaux wrote:
>> [on the subject of linking static FFmpeg libs compiled with MinGW into 
>> an MSVC app]
>>
>>> You have to add libgcc.a to the build (mine is in 
>>> C:\MinGW\lib\gcc-lib\mingw32\3.2)
>>
>> Is this really safe? I seem to remember there was a discussion about 
>> this a while back, and the conclusion was that while linking to 
>> libgcc.a works, it is a Bad Thing in some way or another, and that the 
>> libgcc.a runtime doesn't play well in an MSVC environment... 
> 
> Its only a very small part of the gcc runtime, the one containing 
> functions called because the call is generated by the compiler for some 
> kinds of math operations on types not supported by the hardware.

Found a description here:

http://gcc.gnu.org/onlinedocs/gccint/Libgcc.html

Most of that shouldn't be a problem -- probably with the exception of 
the exception handling routines (no pun intended). Since ffmpeg is pure 
C, it should never need those, but in a C++ environment, it could play 
havoc -- maybe that's the reason why linking to libgcc is "considered 
harmful"?

BTW, sorry for the delay in replying. I was hoping someone would jump in 
with some definitive info... unfortunately, no one did...

>> IIRC, the gist was that there was no good way to link a MinGW compiled 
>> static lib into an MSVC app and the only "clean" solution is link 
>> against DLLs.
> 
> Good call, the OP did not actually specify whether he linked against 
> static or DLL.

I'm pretty sure it would have had to be static... linking against a DLL 
shouldn't produce those kinds of errors...?

>> All of this is "IIRC" -- can someone jump in to clarify? I don't want 
>> to start any rumours here... from all I know, the libgcc.a solution 
>> may be completely safe...
> 
> And if its not and MSVC support is required, then --enable-shared should 
> be mandatory. OK?

Right. Only question that remains open is... is linking against libgcc OK?

Martin

-- 
Martin B?hme
Inst. f. Neuro- and Bioinformatics
Ratzeburger Allee 160, D-23538 Luebeck
Phone: +49 451 500 5514
Fax:   +49 451 500 5502
boehme at inb.uni-luebeck.de





More information about the ffmpeg-devel mailing list