Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Subject: DLL's for Dummies To: cygwin AT cygwin DOT com X-Mailer: Lotus Notes Release 5.0.6a January 17, 2001 Message-ID: From: "David Westbury" Date: Tue, 6 Nov 2001 09:30:08 -0500 X-MIMETrack: Serialize by Router on SWMTA1.ipaper.com/IPAPER(Release 5.0.8 |June 18, 2001) at 11/06/2001 08:31:05 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii I recently got started with Cygwin. What a great package! Coming from a Unix programming background I'm completely in the dark about DLL's. I need to write C programs that access a third party API. I'm experimenting with gcc but having disappointing results. I'm trying to compile and run an example C program that came with the third party API package. Although I don't know how to compile a program against a DLL I've found that the gcc string below results in an error free compile/link. The resulting executable runs to some degree. Some API calls execute correctly. However using the gdb debugger it appears that random memory locations are being modified as I step through the program. The program employs elements of a structure as arguments to the API calls. The debugger shows that, in addition to modifying the correct structure elements, random elements of the structure are also being modified as I step over many of the API calls. Also memcpy() appears to produce similar memory corruption. I'm hoping this will ring a bell with someone who can guide me in the right direction. Here is the gcc string I'm using: gcc -g myprog.c -o myprog /path to third party dll/api.dll I've been working with this for days. Forgive me if I haven't read the right FAQ or documentation. I've scanned about everything I can find. Any help would be greatly appreciated. Thanks. -- 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/