This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: dynamic_cast() between a program and a dlopen()ed library
- From: Brian Dessent <brian at dessent dot net>
- To: edam <edam at waxworlds dot org>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 14 Nov 2008 07:39:05 -0800
- Subject: Re: dynamic_cast() between a program and a dlopen()ed library
- References: <491D8F9A.3080504@waxworlds.org>
- Reply-to: gcc-help at gcc dot gnu dot org
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