This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: windows and cygwin compiled dll ?


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@rfk.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]