public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Gerrit P. Haase" <gp@familiehaase.de>
To: Frank Motta <fmotta@embedded-guru.com>
Cc: cygwin@cygwin.com
Subject: Re: help with using windows dll
Date: Wed, 10 Apr 2002 13:10:00 -0000	[thread overview]
Message-ID: <26291377488.20020410220955@familiehaase.de> (raw)
In-Reply-To: <18076.65.200.9.2.1018465049.squirrel@portal.embedded-guru.com>

> -------- Original Message --------
> Subject: =?iso_8859_1?Q?can_a_pre-built_library_be_used=3F?=
> From: "Frank Motta" <fmotta at embedded-guru dot com>
> To: <cygwin at cygwin dot com>

> I have a third party lib/dll (x.lib, x.dll) built with microsoft tools
> I need to link to a cygwin application.

> Since cygwin can't use the .lib then is there a way of extracting the
> equivilent stubs from the .lib or the dll?

>     Is this possible?

>     If so, how!!!

I used to do this with a tool that comes with libtool.
It isn't provided in binary form with the libtool setup,
but gets build everytime it is needed by libtool.
I've it on a website to fetch it for others (just the
C source and the compiled binary).

I use it with this stupid script which is invoked like this,

        $ libextract /path/DLLNAME

where DLLNAME is the dllname without .dll:

#!/usr/bin/sh
echo $0 creates import library $1.dll.a from $*.dll
DLLNAME=$@

/bin/impgen ${DLLNAME}.dll >${DLLNAME}.def
dlltool --as=as --dllname ${DLLNAME}.dll --def ${DLLNAME}.def --output-lib ${DLLNAME}.dll.a
# ENDE

Extract the 'impgen' source from ltmain.sh or fetch it here:
http://timtowtdi.topcities.com/cygwin/impgen/

My script needs some improvements since importlibraries are usually
named in another fashion.  Here cygbz21.0.dll gets cygbz21.0.dll.a as
importlib where the real one is named libbz2.dll.a.
But you can either link directely to the name you created the importlib
with or rename it as you like it.

Also I should mention that it works with some Windows dll's and with
others it doesn't work and I don't know why.


Gerrit
-- 
=^..^=


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

  reply	other threads:[~2002-04-10 20:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-10 12:31 Frank Motta
2002-04-10 13:10 ` Gerrit P. Haase [this message]
2002-04-10 14:04   ` Frank Motta
2002-04-11 13:25 Heribert Dahms

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26291377488.20020410220955@familiehaase.de \
    --to=gp@familiehaase.de \
    --cc=cygwin@cygwin.com \
    --cc=fmotta@embedded-guru.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).