Re: Creating C library implemented in C++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



lrtaylor@xxxxxxxxxx writes:

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

The reason I used the gcc driver instead of g++ was that I wanted the
gcc libraries statically linked, and g++ overrode my attempts to link
statically.  It was a while back that I switched to the gcc driver, so
my recollection of the issues is getting a bit vague.  I'll retry with
g++ and see if I can get it to work the way I want.  

Thanks,
Stuart

> 
> Cheers,
> Lyle
> 
> -----Original Message-----
> From: Stuart F. Downing [mailto:sdowning@xxxxxxxx] 
> Sent: Tuesday, October 21, 2003 9:48 AM
> To: gcc-help@xxxxxxxxxxx
> 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.  
> 
> 


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux