Usually (read: for all DLLs created with MinGW and also a few others) MinGW links fine against a DLL. However there are situations when it won't. Then one needs a so-called import library to help the linker. The rest of this page gives hints as to how to create such import libraries when there is only the DLL available.
MinGW comes with a handy tool which does most of the work for you:
dlltool.exe (or i586-mingw32-dlltool or something similar). Issue 'dlltool --help' to get a brief description of the available options.
Sometimes dlltool can create an import library from the DLL. But then you wouldn't need an import library since the linker wouldn't need one. So you probably are reading this because you've got a DLL against which MinGW can't link without further help. You will provide this help by creating a def-File. There are several ways to create such a file. In the following some of these will be described:
Once you've created the def-File (see above) you'll issue
dlltool -d somedll.def -l libsomedll.a
Depending on the DLL you may want to try one or more of the following:
For a detailed description of these options and dlltool take a look at the corresponding documentation.
That's it. The resulting file libsomedll.a should satisfy the linker.
LIBRARY Diverg01.dll EXPORTS Divergences LTDivergences STDivergences
LIBRARY DB2CLI.dll EXPORTS SQLAllocConnect@8 SQLAllocEnv@4 SQLAllocHandle@12 SQLAllocStmt@8 SQLBindCol@24 SQLBindFileToCol@32 SQLBindFileToParam@32 SQLBindParam@32 SQLBindParameter@40 SQLBrowseConnect@24 SQLBrowseConnectW@24 SQLBuildDataLink@40 SQLBulkOperations@8 ...