Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / December 2005



Tip: Looking for answers? Try searching our database.

Catching Exception in Static Library

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alexander Grau - 28 Dec 2005 23:18 GMT
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");
}
Alexander Grau - 29 Dec 2005 11:51 GMT
I could solve the issue by adding a compiler flag (-fexceptions) and now
the exception is already catched in the static library :-)

Alexander
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.