Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3CECC567.30100@uni.de> Date: Thu, 23 May 2002 12:33:11 +0200 From: Dennis Jarosch User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.0rc2) Gecko/20020510 X-Accept-Language: de-de, en-us, en MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: linking cygwin built dll with Borland C++Builder Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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/