This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ program with C shared object?


Bjorn,

Thank you very much for explaining the 'Aborted.' message, that was 
helpful. Wrapping the C library in question is fairly large, so wrapping it 
would take quite a bit of work. Also, the reason I'm asking is to create a 
C++ wrapper-library which uses exceptions directly, rather than wrap each C 
function with a C++ one.

Anyway, I may have explained this before, but the C library provides an 
error handling subsystem that allows you to provide a callback function to 
handle errors. I'd like to provide the library a callback that throws 
exceptions. A quick test showed this works in MS-VC++, but we wish the 
solution to be cross-platform, so I want the code to work on GCC as well.

Are there some compiler switches that GCC might automatically enable for 
C++ code and not for C code, that I should try?

>  I do not quite understand, why you want to propagate exceptions through
>the C library. It ought to be quite a bit easier to make a C++ wrapper
>for the library.
>
>Yours sincerely,
>
>Bjorn

-- 
Joshua Pollak       (617) 491-3474 x586
Software Engineer         joshp@cra.com
Charles River Analytics     www.cra.com
---------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]