Boost logo

Boost Users :

From: Austin Bingham (austin.bingham_at_[hidden])
Date: 2006-10-17 12:18:36


I couldn't find any reference to this in the mailing list archives, so
I apologize if this is a rehash.

Synopsis: I'm experiencing a problem when I try to any_cast a value of
an enumeration type while inside code that's part of a dynamically
loaded library.

I have one library that defines an enumeration. I have an application
that packages up a value of this enumeration type into a boost::any.
The application then dynamically loads yet another library and passes
this any to a function in the newly loaded library. However, when the
code in the DL library tries to any_cast the enumeration value out of
the any, I receive a bad_any_cast exception.

I've instrumented the any_cast code and have verified that the
type_info.name() strings for both the stored and requested types are
the same. However, the operator== for the type_info's is still
returning false.

As far as I know, type_info comparison across dynamically loaded
libraries should work as long as operator== is used. Does anyone have
any idea if this is a compiler issue (as I think it is)? Has anyone
else experienced this kind of issue?

Here's some system info that may be relevant:

   g++ 4.1.0
   linux 2.6.16.13-4-smp (SuSE 10's default kernel)
   boost 1.32.0
   binutils 2.16.91.0.5-18

--
Austin Bingham

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net