----- Original Message -----
From: "Lloyd Dupont" <lloyd@...>
Sent: Tuesday, June 21, 2005 3:03 PM
Subject: [Mingw-users] ahum.... (MS) CL support?
how do I write a DLL usable by VS.2005?
withh GCC I just do like that
--- dll.c -----
DLL_EXPORT void doNothing()
gcc -shared -o mydll.dll dll.c
and that's it, I could use it with '-lmydll'
For CL I know it involves additional steps, such as generate a .lib file, or
stuff like that....
Here's an excerpt from a post that I kept in relation to doing precisely
what you're asking about wrt the GMP library. In it, 'libgmp-3.dll' is a dll
that has been built using MinGW (gcc). 'Dumpbin' and 'Lib' are both
executables located in the Visual Studio bin folder.
1. Use 'DUMPBIN /EXPORTS libgmp-3.dll' to get a symbol list. Redirect to
some convenient text file.
1.1. If this is the first time you've used an MSVC++ 6 command line tool
in awhile, you'll probably need to set up your environment properly. Use
ms provided Vcvars32.bat to do this (found in the Vc98/bin directory).
1.1.1. If you are running from an ms-dos prompt and run out of
environment space, increase same by maxing out initial environment space
in the properties:memory dialog for your ms-dos prompt.
2. Handbuild libgmp-3.def with the symbol list from step 1.
2.1. libgmp-3.def is a text file that looks like:
2.1.1. If your goal is to do this with only ms provided tools, you can
easily extract just the 382 symbols from the output of step 1 by
importing into excel.
3. Use 'LIB /DEF:libgmp-3.def /OUT:libgmp-3.lib' to create your lib.
That gives you the '.lib' file you need to link to at compile-time. The
gcc-built dll needs to be locatable at runtime (and perhaps also at compile
time ?? .... not sure).