Problem with boost 1.36, vs2005 and serialization library -> linker problem
::archive_pointer_oserializer
> (class boost::serialization::extended_type_info const &)" (??0?$archive_pointer_oserializer@V?$polymorphic_oarchive_route@V?$binary_oarchive_impl@Vbinary_oarchive@archive@boost@@DU?$char_traits@D@std@@@archive@boost@@@detail@archive@boost@@@detail@archive@boost@@$$FIAE@ABVextended_type_info@serialization@3@@Z)
Hello,
in my application I wrote the serialization like in the pimpl example.
With boost 1.34.1 this has worked. But now I have a few strange linker
errors.
e.g
Error 1413 error LNK2001: unresolved external symbol "protected:
__thiscall boost::archive::detail::archive_pointer_oserializer
I've always had problems with BOOST_CLASS_EXPORT. The issues of been of various character from the concept of what it does and/or should do, how it should/should not be used, and how it is implemented. In 1.36, I spend some time considering BOOST_CLASS_EXPORT more carefully and have updated the documentation regarding its usage. I would suggest taking a look at the 1.36 documentation regarding BOOST_CLASS_EXPORT and checking the code to verify that it follows the recommendations in the current documentation. Robert Ramey Hansi wrote:
Hello,
in my application I wrote the serialization like in the pimpl example. With boost 1.34.1 this has worked. But now I have a few strange linker errors.
e.g
::archive_pointer_oserializer
> (class boost::serialization::extended_type_info const &)" (??0?$archive_pointer_oserializer@V?$polymorphic_oarchive_route@V?$binary_oarchive_impl@Vbinary_oarchive@archive@boost@@DU?$char_traits@D@std@@@archive@boost@@@detail@archive@boost@@@detail@archive@boost@@$$FIAE@ABVextended_type_info@serialization@3@@Z) Error 1413 error LNK2001: unresolved external symbol "protected: __thiscall boost::archive::detail::archive_pointer_oserializer
> main.obj and
Error 1414 error LNK2001: unresolved external symbol "protected: __thiscall boost::archive::detail::archive_pointer_iserializer<class boost::archive::polymorphic_binary_iarchive>::~archive_pointer_iserializer<class boost::archive::polymorphic_binary_iarchive>(void)" (??1?$archive_pointer_iserializer@Vpolymorphic_binary_iarchive@archive@boost@@@detail@archive@boost@@$$FIAE@XZ) main.obj
The problem has something to do with BOOST_CLASS_EXPORT(A) function. If I don't include it there is not the problem with the linker error. In the cpp file I have at the moment the instantion
template void A::serialize(boost::archive::polymorphic_iarchive & ar,const unsigned int file_version); template void A::serialize(boost::archive::polymorphic_oarchive & ar,const unsigned int file_version);
and
template void A::serialize(boost::archive::binary_iarchive & ar,const unsigned int file_version); template void A::serialize(boost::archive::binary_oarchive & ar,const unsigned int file_version);
What I have to do to solve that?
Best regards Hansjörg
I have read the recommandation about BOOST_CLASS_EXPORT in the documentation. I think that I have done all... With BOOST_SERIALIZATION_SHARED_PTR the compilation is is working...I use this now. Thank you Robert Ramey schrieb:
I've always had problems with BOOST_CLASS_EXPORT. The issues of been of various character from the concept of what it does and/or should do, how it should/should not be used, and how it is implemented.
In 1.36, I spend some time considering BOOST_CLASS_EXPORT more carefully and have updated the documentation regarding its usage. I would suggest taking a look at the 1.36 documentation regarding BOOST_CLASS_EXPORT and checking the code to verify that it follows the recommendations in the current documentation.
Robert Ramey
Hansi wrote:
Hello,
in my application I wrote the serialization like in the pimpl example. With boost 1.34.1 this has worked. But now I have a few strange linker errors.
e.g
::archive_pointer_oserializer
> (class boost::serialization::extended_type_info const &)" (??0?$archive_pointer_oserializer@V?$polymorphic_oarchive_route@V?$binary_oarchive_impl@Vbinary_oarchive@archive@boost@@DU?$char_traits@D@std@@@archive@boost@@@detail@archive@boost@@@detail@archive@boost@@$$FIAE@ABVextended_type_info@serialization@3@@Z) Error 1413 error LNK2001: unresolved external symbol "protected: __thiscall boost::archive::detail::archive_pointer_oserializer
> main.obj and
Error 1414 error LNK2001: unresolved external symbol "protected: __thiscall boost::archive::detail::archive_pointer_iserializer<class boost::archive::polymorphic_binary_iarchive>::~archive_pointer_iserializer<class boost::archive::polymorphic_binary_iarchive>(void)" (??1?$archive_pointer_iserializer@Vpolymorphic_binary_iarchive@archive@boost@@@detail@archive@boost@@$$FIAE@XZ) main.obj
The problem has something to do with BOOST_CLASS_EXPORT(A) function. If I don't include it there is not the problem with the linker error. In the cpp file I have at the moment the instantion
template void A::serialize(boost::archive::polymorphic_iarchive & ar,const unsigned int file_version); template void A::serialize(boost::archive::polymorphic_oarchive & ar,const unsigned int file_version);
and
template void A::serialize(boost::archive::binary_iarchive & ar,const unsigned int file_version); template void A::serialize(boost::archive::binary_oarchive & ar,const unsigned int file_version);
What I have to do to solve that?
Best regards Hansjörg
------------------------------------------------------------------------
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
I just ran into this problem using the graphml read feature and found
that it is also failing in some tests:
*http://tinyurl.com/5dyw4n
The error is:
error LNK2019: unresolved external symbol "void __cdecl
boost::read_graphml(class std::basic_istream
participants (3)
-
Hansi
-
Raindog
-
Robert Ramey