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 Message-ID: <41756.65.200.9.2.1018470910.squirrel@portal.embedded-guru.com> Date: Wed, 10 Apr 2002 13:35:10 -0700 (PDT) Subject: Re: help with using windows dll From: "Frank Motta" To: In-Reply-To: <26291377488.20020410220955@familiehaase.de> References: <26291377488 DOT 20020410220955 AT familiehaase DOT de> X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: Reply-To: fmotta AT embedded-guru DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=iso_8859_1 Content-Transfer-Encoding: 8bit WOW!!! Thanks!!! this is great!!! I've installed and run it and (visually) it appears to give me what I need - the next test is (of course) link and run :} >> -------- 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 > -- > =^..^= -- Frank Motta fmotta AT embedded-guru DOT com If you cannot recognize divinity in your fellow man, then you will not realize the devine within yourself... -- 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/