Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm list-help: list-post: Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-apps AT sourceware DOT cygnus DOT com Date: Fri, 9 Jun 2000 12:49:09 -0400 From: Chris Faylor To: "Parker, Ron" Cc: cygwin-apps AT sourceware DOT cygnus DOT com, cygwin-developers AT sourceware DOT cygnus DOT com Subject: Re: [cet AT carlthompson DOT net: Re: Extreme newbie here...] Message-ID: <20000609124909.A23155@cygnus.com> Reply-To: cygwin-developers AT sourceware DOT cygnus DOT com Mail-Followup-To: "Parker, Ron" , cygwin-apps AT sourceware DOT cygnus DOT com, cygwin-developers AT sourceware DOT cygnus DOT com References: <200006091640 DOT JAA15677 AT cygnus DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <200006091640.JAA15677@cygnus.com>; from rdparker@butlermfg.com on Fri, Jun 09, 2000 at 11:39:34AM -0500 On Fri, Jun 09, 2000 at 11:39:34AM -0500, Parker, Ron wrote: >As a side note, I finally tracked down what was needed to release a new gcc >w/o the i686-pc-cygwin directory, but will not be able to do so ... you got >it ... until I get home this evening. BTW, Chris you should add >"gcc_tooldir=/usr" and "gcc_tooldir=$inst/usr" to the appropriate make >commands in the script from which you mailed excerpts yesterday. Will do. Thanks for the heads up. It looks like I have to add a MANIFEST ability too since I screwed up gdb without noticing. >There may also be a problem of -mno-cygwin picking up the cygwin header >files in some cases. I am looking into this. I thought I saw this complaint. >I can say that at least the following trivial program works both when >compiled as C with gcc and as C++ with my modified g++. > ><--- hello.c ---> >#include > >int APIENTRY WinMain(HINSTANCE a1,HINSTANCE a2,LPSTR a3,int a4) >{ > MessageBox(NULL, "Hello, world!", NULL, MB_OK); > > return 0; >} ><--- End hello.c ---> > >However adding the simplest exception handling construct as in the following >code creates a link error. > ><--- eh_hello.cpp ---> >#include > >class foo >{ >}; > >int APIENTRY WinMain(HINSTANCE a1,HINSTANCE a2,LPSTR a3,int a4) >{ > try { > throw foo(); > } > catch (foo& f) > { > MessageBox(NULL, "Hello, world!", NULL, MB_OK); > } > > return 0; >} ><--- End eh_hello.cpp ---> > >Link error: > >bash-2.04$ g++ -mno-cygwin -fno-rtti hello.cpp -o hello >/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2/libgcc.a(_eh.o): In function >`_eh_rtime_match': >/home/src/gcc-2.95.2/gcc/./libgcc2.c(.text+0x389): undefined reference to >`_impure_ptr' >collect2: ld returned 1 exit status > >If your source code will compile with -fno-exceptions, it should work in >most cases. Hmm. We noticed this when building strace and Mumit submitted a workaround for it. If you search the cygwin-developers archive you might find the reason for this. I think that the gcc library is somehow pulling in bits of the cygwin library. Thanks for the synopsis, Ron. Much appreciated. cgf