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: linking cygwin built dll with Borland C++Builder


Mixing C++ between compilers generally doesn't work. See the c++-faq
lite for more details.

Rob


> -----Original Message-----
> From: Dennis Jarosch [mailto:ya_luva@uni.de] 
> Sent: Thursday, May 23, 2002 8:33 PM
> To: cygwin@cygwin.com
> Subject: linking cygwin built dll with Borland C++Builder
> 
> 
> 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/
> 
> 

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