• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Exceptions between DSOs not working, how to find cause?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exceptions between DSOs not working, how to find cause?


  • Subject: Re: Exceptions between DSOs not working, how to find cause?
  • From: Mario Emmenlauer <email@hidden>
  • Date: Sat, 21 Nov 2009 12:58:15 +0100



Mario Emmenlauer wrote:
Mario Emmenlauer wrote:
before waisting someones time: I know this has been asked before
and I (think I) know the solution, i.e. a good starting point was
http://lists.apple.com/archives/Xcode-users/2006/Jul/msg00400.html

My problem: when I throw an exception from a dll, I can not catch
it in other static libraries - I can only 'catch (...)'.

Stated in the link above, typical problems are:
 - It doesn't work properly if your code doesn't obey the one definition
   rule: http://en.wikipedia.org/wiki/One_Definition_Rule
 - Your DSOs need to export all their symbols

I have added '-fvisibility=default' to CFLAGS, and explicitly set
'__attribute__((visibility("default")))' in the declaration of the
exception class. So the problem must be the ODR?

Same after adding -shared-libgcc to linker and compiler flags. Same behavior with gcc-4.2.1.


We have a gigantic codebase, is there a way I can (simply) find if
ODR is violated? Can I look up the symbol of the Exception class
manually?

When I do forward declaration of the same class in other places (for
use as a pointer) without '__attribute__((visibility("default")))',
is that a violation/problem too?

Can somebody please verify that the forward declaration is indeed the cause of the problem? Seems, by asking the question I pushed myself to the correct google keywords :-) I found the following page, which says forward declarations break typeinfo(): http://www.k-3d.org/wiki/One_Definition_Rule#Real_World_Example

Is this really the problem? Then I will have to remove hundreds
of forward declarations :-(


gcc-4.0.1
MacOS 10.6.2
compiled from qmake-generated Makefiles

Thanks for all help,

Mario


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • [solved] Re: Exceptions between DSOs not working, how to find cause?
      • From: Mario Emmenlauer <email@hidden>
References: 
 >Exceptions between DSOs not working, how to find cause? (From: Mario Emmenlauer <email@hidden>)
 >Re: Exceptions between DSOs not working, how to find cause? (From: Mario Emmenlauer <email@hidden>)

  • Prev by Date: Re: Exceptions between DSOs not working, how to find cause?
  • Next by Date: Assembler directive?
  • Previous by thread: Re: Exceptions between DSOs not working, how to find cause?
  • Next by thread: [solved] Re: Exceptions between DSOs not working, how to find cause?
  • Index(es):
    • Date
    • Thread