Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 10 Apr 2002 22:09:55 +0200 From: "Gerrit P. Haase" Reply-To: "Gerrit P. Haase" Organization: Esse keine toten Tiere X-Priority: 3 (Normal) Message-ID: <26291377488.20020410220955@familiehaase.de> To: Frank Motta CC: cygwin AT cygwin DOT com Subject: Re: help with using windows dll In-Reply-To: <18076.65.200.9.2.1018465049.squirrel@portal.embedded-guru.com> References: <18076 DOT 65 DOT 200 DOT 9 DOT 2 DOT 1018465049 DOT squirrel AT portal DOT embedded-guru DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > -------- Original Message -------- > Subject: =?iso_8859_1?Q?can_a_pre-built_library_be_used=3F?= > From: "Frank Motta" > To: > 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/