Exceptions between DSOs not working, how to find cause?
Exceptions between DSOs not working, how to find cause?
- Subject: Exceptions between DSOs not working, how to find cause?
- From: Mario Emmenlauer <email@hidden>
- Date: Sat, 21 Nov 2009 11:11:25 +0100
Hi,
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?
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?
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