Mail Archives: cygwin/2002/05/23/06:34:09
Hi!!
I have successfully built a .dll with cygwin (c-Files, using the
mingw-compiler) and converted it to a .lib using Borland's implib.
Using the .lib in my Borland C++Builder 5 project is no problem at all,
however there seem to be alignment problems between the gcc .dll/.lib
and the Borland code. :-(
The problem is that I have created a C++ wrapper to the c-dll and I am
exchanging data with structs. I have a malloced mem-space containing
structs and as I iterate through it, the struct-data gets mixed up. What
I am saysing is that only the first element is correct. I have been able
to (dirty hack) solve this problem by casting to char* and incrementing
by 4 byte * iteration, because this is what is lost in every iteration.
Also, when I try to free the allocated mem-space I sometimes get
exceptions, which I suspect is due to the different interpretation of
the structs in memory!
I have tried the -fnative-struct switch in gcc, as well as many other
flags. I have also played with Borland's alignment (byte... quad word).
Has anyone made similar experiences, or does anybody have any hints on
how to correct these problems?
Please help! ;-)
Thanks!
Dennis
PS: I am not subscribed to the list
--
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 -