From: Valeri DOT Faine AT cern DOT ch ("Valery Fine") Subject: How to build DLLs (Re: Minor bug and a question) 11 Feb 1997 12:36:30 -0800 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199702110912.KAA93162.cygnus.gnu-win32@sp065.cern.ch> Comments: Authenticated sender is Original-To: Chris Cowan Original-CC: gnu-win32 AT cygnus DOT com X-mailer: Pegasus Mail for Windows (v2.23) Original-Sender: owner-gnu-win32 AT cygnus DOT com On 10 Feb 97 at 10:42 Chris Cowan wrote: > Now the question: > > I am wondering how one goes about listing the exported symbol table > of a *.dll? I tried using nm with no success. Does Mircosoft > ship a comparable utility to nm? > I've attached a code ( I hacked some times ago) to produce a Module Definition File (.DEF) for MS SDK from object (C/C++) files. (see http://www.ifh.de/CHEP97/chep97.html Dynamic libraries: maintaining a single source for Unix &Windows also). It works well but must be improved. This doesn't work with the global variables and constants. I wonder someone has a skill to make this thing up and complete it. This must be polished for the object files done with Fortran compiler too. (The separate story is a Fortran COMMON blocks. For those I have no right solution at all yet). I believe this can be done as a separate (FREE !!! ) utility. May be it needs a separate option to distniguish the brand of the object file: let's say from MS, Borland, gcc, Symantec, COFF etc. Alas MS Linker doesn't understand IMPORTS so anyway to access the global pointers and keep a single source for both platforms as UNIX as WIN32 one has to change the source to access the global pointers indirectly (via Set/Get static function for example). There are other solutions. 1. Jason Tishler adviced to use DUMPBIN output and offered his script to do so. "I wrote a perl script that automatically generates the DLL definition file needed to build a C++ DLL. Perhaps it will meet your needs or at least be a good starting point." 2. Gunther Ebert gcc -c ar rc ranlib echo EXPORTS > <.def file> nm | grep " [CT] " | sed '/ _/s// /' | awk '{print $3;}' >><.def file> This works fine for me. Hope this helps, Valery ================================================================= Dr. Valery Fine Telex : 911621 dubna su ----------- LCTA/Joint Inst.for NuclearRes Phone : +7 09621 6 40 80 141980 Dubna, Moscow region Fax : +7 09621 6 51 45 Russia mailto:fine AT main1 DOT jinr DOT dubna DOT su mailto:fine AT vxcern DOT cern DOT ch Dr. Valeri Faine ------------ Phone: +41 22 767 6468 CERN FAX : +41 22 782 2601 CH-1211 Geneva, 23 mailto:fine AT vxcern DOT cern DOT ch Switzerland http://nicewww.cern.ch/~fine - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".