delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/04/14:39:26

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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: <3E173851.5040705@lapo.it>
Date: Sat, 04 Jan 2003 20:38:57 +0100
From: Lapo Luchini <lapo AT lapo DOT it>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3b) Gecko/20030102
X-Accept-Language: it, en, fr, es
MIME-Version: 1.0
To: Mailing List: CygWin <cygwin AT cygwin DOT com>
Subject: g++, shared/static and exceptions
X-Enigmail-Version: 0.71.3.0
X-Enigmail-Supports: pgp-inline, pgp-mime

Hi.
As I said in other messages I'm "freshening" my C++ skills thanks to a 
university project I must do, guess what, in C++ (I passed from C to 
Java some years ago but now, with STL and exceptions... but that's 
another story).

I'm using gcc 3.2 (but it must work also with 2.95), libexpat, 
libcppunit for "make check" and the full suite of the autotools (which 
is good, as I now know them much better).

I have a small problem though: I recently decided to do things "cleanly" 
and separated my program in a generic library and a set of "example 
programs" that use it.

Two problems here.

The first problem is that the library must be static as libstdc++ isn't 
available as a DLL (that's right? will it be available someday?), but 
this is not a big problem as libtool makes it very easy to use 
"--disable-shared" in the configure.
The real problem is that the exceptions thrown in the library seems to 
always "dump" the program, and can't be catched in the main (which is 
not in the lirary, of course).

I made my good Google search and I found various interesting things on 
the gcc mailing list (and in other places), the main thing being the 
following thread:
http://mail.gnu.org/pipermail/libtool/2002-May/006309.html

That make two more question raise in my head though:
1. it talks about DLL not propagating the exceptions, and I'm using a 
static library.. is a static library net meant for propagating them (so 
that the thread avoid the problem as 'not possible') or the opposite? 
(i.e. they alweays work in static libs)
2. it talks about C++ DLLs... are they possible at all? my libtool 
screams that it cannot create a dynamic library that uses a static 
library... (maybe there is some way to say to it "just include it all"? 
but the, at linking time, wouldn't there be two copies of the stdc++ 
library?)

Thanks for the help ;)

Lapo

-- 
Lapo 'Raist' Luchini
lapo AT lapo DOT it (PGP & X.509 keys available)
http://www.lapo.it (ICQ UIN: 529796)



--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019