This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How to build DLLs (Re: Minor bug and a question)


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 <jt@boxhill.com> 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 <gunther.ebert@ixos-leipzig.de>

     gcc -c <source files>
     ar rc <tmplib> <compiled source files (.o)>
     ranlib <tmplib>
     echo EXPORTS > <.def file>
     nm <tmplib> | 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@main1.jinr.dubna.su
                                 mailto:fine@vxcern.cern.ch
Dr. Valeri Faine
    ------------                 Phone: +41 22 767 6468
CERN                             FAX  : +41 22 782 2601
CH-1211 Geneva, 23               mailto:fine@vxcern.cern.ch 
Switzerland                      http://nicewww.cern.ch/~fine
                                 
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]