Subject: Re: linking against DLLs
From: [email-masked] (bowman)

16 Jan 1999 14:05:38 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: James Scott <[email-masked]>, [email-masked]

James Scott wrote:
> 
> Hi,
> 
> I'm having trouble linking against a DLL after following the instructions
> in the user guide

for MS dll's, you can use 'impdef' do get a list of the entries. Note
that these do not have a '@xx' suffix, where 'xx' is the size of the
parameters on the stack. You can edit this file against the header. The
rule of thumb seems to be, 4 bytes per parameter, so Foo() would be  
Foo@0,  Foo(int, int, char*) Foo@12, etc. I think Anders Norlander has a
tool for this fixup on the def files, but I haven't used it.

Then you can say,

dlltool -D foo.dll -d foo.def -llibfoo.a -k

NB: the '-k' kills the export of the decorated name. Gcc needs to see
the *@xx form, while the dll must be called with the undecorated name.

afaik, the instructions on the web site are for linking against a dll
created by gcc, not a MS dll. The above seems to work for me, but if
there is an easier or more correct procedure, I'd like to see it.
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".