delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/05/29/11:10:12

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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: <4.3.1.2.20020529093551.0273ae60@pop.ma.ultranet.com>
X-Sender: lhall AT pop DOT ma DOT ultranet DOT com
Date: Wed, 29 May 2002 10:02:16 -0400
To: Stefan Hansen <Stefan DOT Hansen AT gmx DOT net>, cygwin AT cygwin DOT com
From: "Larry Hall (RFK Partners, Inc)" <lhall AT rfk DOT com>
Subject: Re: windows and cygwin compiled dll ?
In-Reply-To: <25240.1022654304@www19.gmx.net>
References: <4 DOT 3 DOT 1 DOT 2 DOT 20020528100521 DOT 025e8130 AT pop DOT ma DOT ultranet DOT com>
Mime-Version: 1.0

At 02:38 AM 5/29/2002, Stefan Hansen wrote:
> > At 09:52 AM 5/28/2002, Stefan Hansen wrote:
> > > > At 07:32 AM 5/28/2002, Stefan Hansen wrote:
> > > > >Hi there,
> > > > >
> > > > >I want to add a, dll which I compiled under cygwin, to my MSVC++
> > project.
> > > > >If I am correct I need a lib file of this dll. How can I create this
> > lib
> > > > >file ?
> > > > 
> > > > 
> > > > Why not just use the Cygwin .a import library?
> > >
> > >Linking whith .a (which i copy to .lib) is no problem. But during the
> > >execution i got an Access Violation.
> > 
> > 
> > Then it's unlikely that creating a .lib instead will help you.  The .lib
> > will be the same import library as the .a.
>
>If this librarys are the same, why dlltool ? or are im stupid at all ?


dlltool is necessary to create an import library from a DLL.  Once the import
library is created though, you don't need dlltool. ;-)


>I think changing the extension is the wrong way. I think using dlltool is
>the proper way.


OK, you should work as you feel comfortable.  I'll only make two comments 
about this statement:

   1. I didn't suggest changing the extension.
   2. dlltool *is* the "proper way" to make an import library from a 
      pre-existing DLL.  Unless I misunderstand what you're doing, this
      isn't your situation.


>OK i can ask my question in an other way. I have created a .dll and an .a
>file whith cygwin. How can i use this in a MSVC++ source ? (I tried some
>different way whith some simpl soucrecodes.) Where are the problems during the
>linking and compiling an how can i solve them. 
>The informations on the cygwin page i found are rare.


It's not recommended because of various complications.  These include (as
Rob Collins pointed out yesterday):

Structure alignment
C runtime
Exception handling
No C++. 

You'll find more discussion of this subject in the email list archives.
However, if you handle these areas properly, you can do what you're 
suggesting.  

You're probably better off looking at Chuck Wilson's site for DLL building
examples.  

http://www.neuro.gatech.edu/users/cwilson/cygutils/


> >  As a result, you'll see the 
> > same access violation. 
>
>The access violation i got in the case of the .a only !


OK.  I guess you're doing something different with the .lib you're 
creating.  I can't say whether that's good or bad.   My guess is that it's
bad but you'll need to debug it to find out for sure.



Larry Hall                              lhall AT rfk DOT com
RFK Partners, Inc.                      http://www.rfk.com
838 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX


--
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/

- Raw text -


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