|
Boost Users : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2005-09-21 10:28:54
This problem has been reported by Martin Ecker. The easy fix is to just
permit multiple definitions of the same virtual functions in different DLLs.
This has eliminated the symptom for this user.
I'm concerned that this won't really work in the general case.
I would be prefer to:
a) trap attempts at multiple registrations of the same class as errors.
b) explain how to avoid these situtations in the first place.
I'm kind of stuck on b). It seems to me that if A (base) is in a DLL and
B(derived) is
in an executable, there should be no multiple definitions of B. But the
brief
description of this user's case seems to suggest that this isn't the case -
though
without more information one can't be sure.
Robert Ramey
Sergey Skorniakov wrote:
>>>> I think I resolved the issue. The problem is that if the base
>>>> class A is defined in the main executable, the dynamically loaded
>>>> DLL apparently uses a different address space for the definition.
>>>> Even if I return a pointer to A from the DLL, I get an
>>>> unregistered void cast exception. (I don't know why. Anyone?) If I
>>>> define the base class in yet another DLL that both the main
>>>> program and the dynamically loaded DLL link to, serialization
>>>> works just fine.
>>>
>>> This is very odd to me - how does B compile in the DLL without
>>>
>>> This is still a murkey area. I believe there are still unresolved
>>> issues here.
>>>
>>
>> I am also encountered the same problem yesterday. The source of evil
>> seems to be in double registration if rtti-enabled class serialized
>> both in dll and in exe. void extended_type_info::self_register()
>> just called twice - from exe and from dll.
>> Later, code such
>> const boost::serialization::extended_type_info * this_type =
>> boost::serialization::type_info_implementation<T>::type::get_instance();
>> const boost::serialization::extended_type_info * true_type =
>> boost::serialization::type_info_implementation<T>::type::get_derived_extended_type_info(t);
>> if(*this_type == *true_type){...
>>
>> works wrong because extended_type_info::operator=(const
>> extended_type_info &rhs) uses just an address of extended_type_info,
>> which can be different in such situation.
>> I had attached sample files illustrating problem.
>>
>
>
>
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
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