dll creation

Christopher Faylor cgf-rcm@cygwin.com
Fri Apr 18 21:10:00 GMT 2003


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 <stdio.h>
>
>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@sourceware.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/



More information about the Cygwin mailing list