delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/01/16/14:05:38

From: bowman AT montana DOT com (bowman)
Subject: Re: linking against DLLs
16 Jan 1999 14:05:38 -0800 :
Message-ID: <36A0BF7E.CECAA202.cygnus.gnu-win32@montana.com>
References: <Pine DOT A41 DOT 4 DOT 03 DOT 9901151747570 DOT 54726-100000 AT mibm1 DOT jims DOT cam DOT ac DOT uk>
Reply-To: bowman AT montana DOT com
Mime-Version: 1.0
To: James Scott <jes23 AT cam DOT ac DOT uk>, gnu-win32 AT cygnus DOT com


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 AT 0,  Foo(int, int, char*) Foo AT 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
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019