[Interest] dynamic_cast failing

Thiago Macieira thiago.macieira at intel.com
Sat Apr 11 22:18:57 CEST 2015


On Saturday 11 April 2015 21:50:53 René J.V. Bertin wrote:
> Can that be something that behaves differently on different OSes, or using
> different C++ runtimes (libstdc++ vs. libc++)?

Runtime, no.

But the OS is a factor. Remember OS X uses Mach-O, and since 10.4 or something 
it has used a two-level lookup. When you link, it records *which* library 
provided a symbol. You can't move the symbol to another library at runtime and 
this may be happening here if the symbol in question is in multiple libraries.

> > Is it OK if the shared library is loaded dynamically (through dlopen)?

Yes, it can be if you did it with RTLD_LOCAL.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list