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 Date: Fri, 18 Apr 2003 15:37:30 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: dll creation Message-ID: <20030418193730.GC24503@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <3EA02548 DOT 8040308 AT nordrhein DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EA02548.8040308@nordrhein.de> User-Agent: Mutt/1.4.1i On Fri, Apr 18, 2003 at 06:18:16PM +0200, Armin Diehl wrote: >i tried a small sample and i always get a protection fault in >cygwin1.dll if i call the funtion in the dll: > >#include > >int hello () >{ > printf ("hello\n"); >} > >gcc -c test.c >gcc -shared -o test.dll test.o > >will create the dll. If hello is called, i get a protection fault in >cygwin1.dll at 000C8C81, Read of address 00000144. > >I already updated everything today. This happens on xp. Is there some >kind of init needed ? (Btw, the calling program does not use the cygwin dll) > >gcc --verion: gcc (GCC) 3.2 20020927 (prerelease) >ld -V: GNU ld version 2.13.90 20030308 If you're calling a cygwin DLL from a non-cygwin app, that just won't work. There is initialization required and, unfortunately, it's currently broken. The maintainer of the initialization code disappeared a couple of years ago. Coincidentally, he was the same person who maintained gcc, binutils, and a few other packages. He reappears from time to time but has not demonstrated any willingness to become reinvolved in cygwin affairs. So, I've reluctantly picked up gcc and binutils and others have taken on the mantle of supporting his other packages. The initialization code is another story, unfortunately. The code which initializes cygwin in non-cygwin apps has fallen into disrepair. None of the other developers (all three or four of them) have shown any interest in getting it working again, so the end result is that it just doesn't work. That's the answer to your query. I'm sorry that it is probably not the answer that you were looking for. If your application is really just as simple as the above, you might want to investigate either using MinGW (www.mingw.org) or using the -mno-cygwin option to gcc. The -mno-cygwin option essentially produces a mingw application with cygwin's gcc. That means that cygwin isn't involved and it is possible to write a pure Windows DLL. cgf -- Please use the resources at cygwin.com rather than sending personal email. Special for spam email harvesters: send email to aaaspam AT sourceware DOT org and be permanently blocked from mailing lists at sources.redhat.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/