Problem with boost 1.36, vs2005 and serialization library -> linker problem

::archive_pointer_oserializer<class boost::archive::detail::polymorphic_oarchive_route<class boost::archive::binary_oarchive_impl<class boost::archive::binary_oarchive,char,struct std::char_traits<char> > > (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<class boost::archive::detail::polymorphic_oarchive_route<class boost::archive::binary_oarchive_impl<class boost::archive::binary_oarchive,char,struct std::char_traits<char> > > 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'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::archive::detail::polymorphic_oarchive_route<class boost::archive::binary_oarchive_impl<class boost::archive::binary_oarchive,char,struct std::char_traits<char> > > (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<class boost::archive::detail::polymorphic_oarchive_route<class boost::archive::binary_oarchive_impl<class boost::archive::binary_oarchive,char,struct std::char_traits<char> > > 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::archive::detail::polymorphic_oarchive_route<class boost::archive::binary_oarchive_impl<class boost::archive::binary_oarchive,char,struct std::char_traits<char> > > (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<class boost::archive::detail::polymorphic_oarchive_route<class boost::archive::binary_oarchive_impl<class boost::archive::binary_oarchive,char,struct std::char_traits<char> > > 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<char,struct std::char_traits<char> > &,class boost::mutate_graph &)" (?read_graphml@boost@@YAXAAV?$basic_istream@DU?$char_traits@D@std@@@std@@AAVmutate_graph@1@@Z) referenced in function "void __cdecl boost::read_graphml<class boost::adjacency_list<struct boost::vecS,struct boost::vecS,struct boost::directedS,struct boost::property<enum boost::vertex_index1_t,class Ogre::Vector3,struct boost::no_property>,struct boost::no_property,struct boost::no_property,struct boost::listS> >(class std::basic_istream<char,struct std::char_traits<char> > &,class boost::adjacency_list<struct boost::vecS,struct boost::vecS,struct boost::directedS,struct boost::property<enum boost::vertex_index1_t,class Ogre::Vector3,struct boost::no_property>,struct boost::no_property,struct boost::no_property,struct boost::listS> &,struct boost::dynamic_properties &)" (??$read_graphml@V?$adjacency_list@UvecS@boost@@U12@UdirectedS@2@U?$property@W4vertex_index1_t@boost@@VVector3@Ogre@@Uno_property@2@@2@Uno_property@2@U52@UlistS@2@@boost@@@boost@@YAXAAV?$basic_istream@DU?$char_traits@D@std@@@std@@AAV?$adjacency_list@UvecS@boost@@U12@UdirectedS@2@U?$property@W4vertex_index1_t@boost@@VVector3@Ogre@@Uno_property@2@@2@Uno_property@2@U52@UlistS@2@@0@AAUdynamic_properties@0@@Z) Any ideas? it seems that write_graphml does not result in linker errors. *
participants (3)
-
Hansi
-
Raindog
-
Robert Ramey