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: Reply-To: bowman AT montana DOT com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: James Scott , 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".