This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Creating C library implemented in C++
- From: lrtaylor at micron dot com
- To: <sdowning at fame dot com>, <gcc-help at gcc dot gnu dot org>
- Date: Tue, 21 Oct 2003 10:04:16 -0600
- Subject: RE: Creating C library implemented in C++
Stuart,
If you declare your functions in an 'extern "C"' block and then compile
and link them with g++, I think you'd have the effect you are looking
for, and your exception handling problem should also be taken care of.
The 'extern "C"' block should disable the name mangling, allowing the
functions to be used from a C program and using their own C compiler.
Linking it with g++ will add all extra command line arguments needed to
enable support for stack unwinding, etc., necessary for exception
handling.
Cheers,
Lyle
-----Original Message-----
From: Stuart F. Downing [mailto:sdowning@fame.com]
Sent: Tuesday, October 21, 2003 9:48 AM
To: gcc-help@gcc.gnu.org
Subject: Creating C library implemented in C++
I am porting a C library to C++. The library is distributed in both
shared and static verstions. The resultant library must still be
callable from C clients.
PROBLEM: Any exceptions thrown result in program termination, not
tranfer of control to the enclosing try/catch.