Re: Is it possible to use RTTI in a dynamic library ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Loïc,

The RTTI mechanism used by dynamic_cast relies upon the address of the type information structure.  It appears that the DSO has a different type information structure for the object than the one being used in the dynamic_cast.  Not good.

What are the compiler/linker flags being used to make the .so?

Does -fweak make a difference?

If you are using -Bsymbolic ... don't use that.

Consider doing a reinterpret_cast<B*>, since you are sure that it is a pointer to B in real life.

Consider changing getFromSoFile() to return a B* instead of an A*.

--Eljay




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux