www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Linking to MinGW-generated library woes

reply Robert Fraser <fraserofthenight gmail.com> writes:
Has anyone been able to successfully link (statically) to a library 
generated by MinGW? I compiled the libraries in question (FFMpeg avutil, 
avformat, and avcodec) under MinGW, ran objconv on it to convert it to 
OMF (no errors) and passed it to optlink along with MinGW's libgcc. At 
this point I got quite a few undefined references:

  Error 42: Symbol Undefined _snprintf
  Error 42: Symbol Undefined ___strtod
  Error 42: Symbol Undefined _gettimeofday
  Error 42: Symbol Undefined _strncasecmp
  Error 42: Symbol Undefined _strcasecmp
  Error 42: Symbol Undefined ___mingw_vfprintf
  Error 42: Symbol Undefined ___fpclassifyf

I've tried with different combinations of adding mingwex and libcoldname 
to the mix, but not only do they add some "previous definition" 
conflicts, neither was able to fix any of the linker errors.

I might be able to manually find & implement all those functions in the 
MinGW source, would this be the best way?

Thanks,
Robert
Jun 15 2009
parent Robert Fraser <fraserofthenight gmail.com> writes:
Robert Fraser wrote:
 Has anyone been able to successfully link (statically) to a library 
 generated by MinGW? I compiled the libraries in question (FFMpeg avutil, 
 avformat, and avcodec) under MinGW, ran objconv on it to convert it to 
 OMF (no errors) and passed it to optlink along with MinGW's libgcc. At 
 this point I got quite a few undefined references:
 
  Error 42: Symbol Undefined _snprintf
  Error 42: Symbol Undefined ___strtod
  Error 42: Symbol Undefined _gettimeofday
  Error 42: Symbol Undefined _strncasecmp
  Error 42: Symbol Undefined _strcasecmp
  Error 42: Symbol Undefined ___mingw_vfprintf
  Error 42: Symbol Undefined ___fpclassifyf
 
 I've tried with different combinations of adding mingwex and libcoldname 
 to the mix, but not only do they add some "previous definition" 
 conflicts, neither was able to fix any of the linker errors.
 
 I might be able to manually find & implement all those functions in the 
 MinGW source, would this be the best way?
 
 Thanks,
 Robert
Never mind; they weren't as hard to implement as I thought.
Jun 15 2009