This is the mail archive of the cygwin 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: Problems using a DLL with Cygwin 64 bit


On Dec 18 14:11, Philip Taylor wrote:
> 
> Thank you for the reply. My situation is this: I was supplied Windows 32-bit
> and 64-bit .dll and .lib files by the manufacturer, which I believe were
> created using MS Visual Studio. These are to enable me to use the API for
> this camera from my software.
> 
> Building using GCC tools with cygwin, my initial attempt at linking with
> this API library failed with the message : "error adding symbols: File in
> wrong format.".
> 
> I then discovered that by creating and using a new .lib file for this API
> DLL, using the pexports and dlltools utilities, I could get the link to
> succeed.
> 
> Then (under 64 bit Cygwin) I got the message "*** fatal error - cygheap base
> mismatch detected".

Yeah, that's what I was trying tro explain in my first reply.  Did you
see the three potential problems I outlined?  You'll have to debug what
the actual problem is.

> What exactly did you mean by "You're not trying to load the Cygwin DLL at
> runtime dynamically?". I am trying to build this application under Cygwin in
> the same way as many others, which all run OK,

The Cygwin DLL is the core DLL providing the POSIX environment
(/usr/bin/cygwin1.dll).  If you build a normal application under Cygwin,
you link against the Cygwin DLL the usual way and that's fine.  "at
runtime dynamically" means, your application is a native, non-Cygwin
binary and you try to load the Cygwin DLL at runtime via the Windows
call LoadLibrary (kind of like dlopen()).  Given your description that's
not the case for you, so nothing to worry about.  Just ignore this.

But that gives me an idea.  Assuming you don't link against this camera
DLL, but rather use dlopen/dlsym to fetch and use the entry points to
that DLL, does it work then?  That would be another thing you could try.

But I assume there's something simple going on.  Try if one of my
other points give a clue.  You could also run your applications under
strace or GDB...


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpF5UE6ggao_.pgp
Description: PGP signature


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