This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dynamic_cast() between a program and a dlopen()ed library


edam wrote:

> I was wondering if anyone could shed some light on a problem I'm having.
> I can't seem to get dynamic_cast() to downcast an object returned from a
> library loaded with dlopen(). I was wondering if this is expected
> behaviour or a bug I'm seeing? From what I've read on the web, I think
> it *should* work.

Have a look at <http://gcc.gnu.org/faq.html#dso>.  Your testcase works
for me after adding RTLD_GLOBAL and linking with -Wl,-E.

Brian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]