Re: dynamic_cast failing weirdly
Re: dynamic_cast failing weirdly
- Subject: Re: dynamic_cast failing weirdly
- From: "Tim Conkling" <email@hidden>
- Date: Wed, 25 Jul 2007 00:30:07 -0400
Thanks Marshall, these resources are very useful. Unfortunately, though, I still can't get this to work. Here's what I tried:
- recompiling my libraries and app with OTHER_CPLUSPLUSFLAGS = -fvisibility-ms-compat
- recompiling my libraries and app with GCC_SYMBOLS_PRIVATE_EXTERN = NO
From what I understand from the emails and technote you pointed me to, either (or at least one) of these techniques should have solved the problem, but my dynamic_casts are still failing. Where did I go wrong?
Thanks,
Tim
On 7/24/07, Marshall Clow <email@hidden> wrote:
>I have a bizarre situation in a project that I'm porting from
>Windows (I just finally got everything to compile and link, so I'm
>really just starting to play with the project, and with Xcode). I
>have RTTI enabled for the project (and each of the several libraries
>that it links against) via the "Enable C++ Runtime Types" build
>setting, and dynamic_casts are resolving to NULL when they really
>shouldn't be. The situation looks roughly like this:
>
>In MyLib:
>class A { //... };
>
>(a function):
>static A* GetA() { // return some A* }
>
>In MyApp:
>class B : public A { //... };
>
>(some code):
>A* a = GetA();
>B* b = dynamic_cast<B*>(a);
>ASSERT(NULL != b);
>// do something with b
New angle, old bug.
See threads in the archives titled "Can't catch exception", and so on.
start here, say
<http://lists.apple.com/archives/xcode-users/2006/May/msg00743.html>.
or here <
http://lists.apple.com/archives/xcode-users/2006/Jul/msg00279.html>
Also read tech note TN2185 'C++ tips and tricks for Mac OS X"
<
http://developer.apple.com/technotes/tn2007/tn2185.html>
--
-- Marshall
Marshall Clow Idio Software <mailto:email@hidden>
It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed,
the hands acquire shaking, the shaking becomes a warning.
It is by caffeine alone I set my mind in motion.
_______________________________________________
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