title: Linking to MSVC DLL from MinGW
body: <p>I'm trying to link the LizardTech GeoExpress DSDK into my own application.  I use gcc so that we can compile on for platforms.  On Linux and Mac this works easily: they provide a static library (<code>libltidsdk.a</code>) and headers and all that we have to do is use them.</p>
  
  <p>Compiling for windows isn't so easy.  They've built the library using Microsoft Visual Studio, and we use MinGW.  I've read the MinGW FAQ, and I'm running into the problems below.  The library is all C++, so my first question: is this even possible?</p>
  
  <p>Just linking against the dll as provided yields "undefined reference" errors for all of the C++ calls (constructors, desctructors, methods, etc).</p>
  
  <p>Based on the MinGW Wiki:
  <a href="http://www.mingw.org/wiki/MSVC%5Fand%5FMinGW%5FDLLs" rel="noreferrer">http://www.mingw.org/wiki/MSVC%5Fand%5FMinGW%5FDLLs</a>
  I should be able to use the utility <code>reimp</code> to convert a .lib into something useable.  I've tried all of the .lib files provided by LizardTech, and they all give "invalid or corrupt import library".  I've tried both version 0.4 and 0.3 of the reimp utility.</p>
  
  <p>Using the second method described in the wiki, I've run pexport and dlltool over the dll to get a .a archive, but that produces the same undefined references.</p>
  
  <p>BTW: I have read the discussion below.  It left some ambiguity as to whether this is possible, and given the MinGW Wiki page it seems like this should be doable.  If it is impossible, that's all I need to know.  If it can be done, I'd like to know how I can get this to happen.</p>
  
  <p><a href="https://stackoverflow.com/questions/1796209/how-to-link-to-vs2008-generated-libs-from-g">How to link to VS2008 generated .libs from g++</a></p>
  
  <p>Thanks!</p>