Problems using a DLL with Cygwin 64 bit

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Dec 18 15:34:00 GMT 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20151218/25dca4f8/attachment.sig>


More information about the Cygwin mailing list