[Serialization] how to use serialization in windows dll

Hi! I meet trouble in use serialization in dll in dll export a function like hi_dll() void hi_dll() { std::mapstd::string,int m_map; std::ostringstream os; boost::archive::text_oarchive oa(os); oa & m_map; std::cout << os.str() << std::endl; } and in exe there is a function hi_exe() code is the same as hi_dll void hi_exe() { std::mapstd::string,int m_map; std::ostringstream os; boost::archive::text_oarchive oa(os); oa & m_map; std::cout << os.str() << std::endl; } in Debug mode , the exe call both hi_exe() and hi_dll() will assert at extended_type_info.cpp line 71 assert(lookup(eti) == m_self->m_map.end()); vc7.1 boost 1.33.1 link with serialization as dll then what to do? thanks in advance. Best Regards mos

This would be best addressed by having the serialization in either the one module (the dll) or the other (mainline exe) but not both. Robert Ramey jiang.yu(mos) wrote:
Hi!
I meet trouble in use serialization in dll in dll export a function like hi_dll() void hi_dll() { std::mapstd::string,int m_map; std::ostringstream os; boost::archive::text_oarchive oa(os); oa & m_map; std::cout << os.str() << std::endl; } and in exe there is a function hi_exe() code is the same as hi_dll void hi_exe() { std::mapstd::string,int m_map; std::ostringstream os; boost::archive::text_oarchive oa(os); oa & m_map; std::cout << os.str() << std::endl; }
in Debug mode , the exe call both hi_exe() and hi_dll() will assert at extended_type_info.cpp line 71
assert(lookup(eti) == m_self->m_map.end());
vc7.1 boost 1.33.1 link with serialization as dll
then what to do? thanks in advance.
Best Regards mos

That's painful! I have used serialization in servral modules already.
I comment the line 71
assert(lookup(eti) == m_self->m_map.end());
and it work.
Is there any risk?
"Robert Ramey"
This would be best addressed by having the serialization in either the one module (the dll) or the other (mainline exe) but not both.
Robert Ramey
jiang.yu(mos) wrote:
Hi!
I meet trouble in use serialization in dll in dll export a function like hi_dll() void hi_dll() { std::mapstd::string,int m_map; std::ostringstream os; boost::archive::text_oarchive oa(os); oa & m_map; std::cout << os.str() << std::endl; } and in exe there is a function hi_exe() code is the same as hi_dll void hi_exe() { std::mapstd::string,int m_map; std::ostringstream os; boost::archive::text_oarchive oa(os); oa & m_map; std::cout << os.str() << std::endl; }
in Debug mode , the exe call both hi_exe() and hi_dll() will assert at extended_type_info.cpp line 71
assert(lookup(eti) == m_self->m_map.end());
vc7.1 boost 1.33.1 link with serialization as dll
then what to do? thanks in advance.
Best Regards mos

Actually I'm uncertain on this point and in fact have changed back and forth on this very point. I believe that various check-ins of extended type info in various branches of the cvs tree reflect this Robert Ramey mos wrote:
That's painful! I have used serialization in servral modules already. I comment the line 71 assert(lookup(eti) == m_self->m_map.end()); and it work. Is there any risk?
"Robert Ramey"
wirte: This would be best addressed by having the serialization in either the one module (the dll) or the other (mainline exe) but not both.
Robert Ramey
jiang.yu(mos) wrote:
Hi!
I meet trouble in use serialization in dll in dll export a function like hi_dll() void hi_dll() { std::mapstd::string,int m_map; std::ostringstream os; boost::archive::text_oarchive oa(os); oa & m_map; std::cout << os.str() << std::endl; } and in exe there is a function hi_exe() code is the same as hi_dll void hi_exe() { std::mapstd::string,int m_map; std::ostringstream os; boost::archive::text_oarchive oa(os); oa & m_map; std::cout << os.str() << std::endl; }
in Debug mode , the exe call both hi_exe() and hi_dll() will assert at extended_type_info.cpp line 71
assert(lookup(eti) == m_self->m_map.end());
vc7.1 boost 1.33.1 link with serialization as dll
then what to do? thanks in advance.
Best Regards mos
participants (3)
-
jiang.yu(mos)
-
mos
-
Robert Ramey