Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Catching Exception in Static Library

 
   Macintosh computer (Home) -> General Discussion RSS
Next:  Sound prefs and multiple accounts  
Author Message
Alexander Grau

External


Since: Oct 24, 2004
Posts: 7



(Msg. 1) Posted: Wed Dec 28, 2005 6:55 pm
Post subject: Catching Exception in Static Library
Archived from groups: comp>sys>mac>programmer>misc (more info?)

Hello-

I'm linking a static library (freeimage.a) against my OS X application
(Xcode). The static library throws an exception (throw [number]) I want
to catch in my application. How can I propagate this C++ Exception into
my program? Is there any compiler switch?

I tried to compile the static library with -shared-libgcc, but this did
not help.

I also checked if exception are catched using the example below and the
handler works. However, not on the library exception.

Any ideas are welcome!

Thanks!

int number=41;
try {
// here I call my library ...

// just for exception testing
throw number;

} catch (...) {
printf("exception");
}

 >> Stay informed about: Catching Exception in Static Library 
Back to top
Login to vote
Alexander Grau

External


Since: Oct 24, 2004
Posts: 7



(Msg. 2) Posted: Thu Dec 29, 2005 7:55 am
Post subject: Re: Catching Exception in Static Library [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I could solve the issue by adding a compiler flag (-fexceptions) and now
the exception is already catched in the static library :-)

Alexander

 >> Stay informed about: Catching Exception in Static Library 
Back to top
Login to vote
Display posts from previous:   
   Macintosh computer (Home) -> General Discussion All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]