I think this has been addressed before but not for 2 years.

I have a model whereby I dynamically load libraries with dlopen then
verify that they are the correct types with dynamic_cast.

dynamic_cast seems to be failing though with gcc (I am using 3.2.1
because that is the version we have here that also works with purify).

Whilst I normally don't cast at all in my code, this is the one
occasion I do - I have built this type of model twice before,
successfully using Solaris compiler (which has all sorts of other
problems) and also on VC7 (obviously using LoadLibrary() etc) and it
worked then.

It is vital I use dynamic_cast because reinterpret_cast would of course
lead to undefined behaviour if the type is a mismatch.

And because the name of the symbol to be loaded is read from a
configuration file, there is no possibility of compile-time checks.

Effectively, is it impossible to do object-broking in this manner using
gcc?

_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to