Subject: Re: Creating a library from a dll
From: DJ Delorie <[email-masked]>

10 Dec 1998 11:45:07 -0500
Message-ID: <[email-masked]>
References: <[email-masked]> <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 4.5 [en] (X11; I; Linux 2.1.126 i586)
X-Accept-Language: en

Triple-T wrote:
> Say I have a dll that I want to use with my program but I don't have a
> library for it so I can't use just do a

<plug>Get the new improved linker!  The latest version of ld (may be in B20.1, is
in gas snapshots) allows you to list the .dll right on the link line!  The
linker generates the import library internally, and fixes up problems with
missing @nn's.</plug>

If you have the new linker, "ld --help" will list all the i386-specific
options, including (for example) --output-def.

> nm whatever.lib > whatever.NM
> cat whatever.nm | egrep '^........ [T]' | sed 's/[^_]*_//' ...

That "nm" would be done to the .dll, not the .lib

> so, what are my choices here ? I found an impdef utility but it only
> generates the def like this .
> 
> EXPORTS
> functioname
> function2
> function3

This format will work with the new linker, as it fixes up these references
on the fly.