From: Dennis J. <ya...@un...> - 2002-05-14 15:08:55
|
Hi! I have a problem regarding mingw-dll's. I have created a dll with mingw on Win2k and a corresponding lib with Borland's implib tool. I am using the lib in a C++Builder project, which is a dll itself (actually it is a wrapper to the mingw-dll). Basically everything works fine, except that I have encountered a problem with a dynamically allocated struct-array. When iterating through the array (xxx[i].struct) in the Borland-compiled code the pointer to the struct is off by a few byte. It seems as if Borland assumes the structs are shorter than they are and so after every iteration the struct points to a few bytes of it's predecessor, making data access to any other struct than the first one impossible. I have started research on alignment and compiler flags and I can say that neither -fnative-struct nor -fpcc-struct-return worked. Playing with the C++Builder's alignment options didn't either! :-( Has anybody seen this before, or does anyone have any idea what else to try? Thanks in advance! Dennis |