|
Boost Users : |
Subject: Re: [Boost-users] [serialization] problems extending existing archivetype
From: Kenny Riddile (kfriddile_at_[hidden])
Date: 2009-06-14 15:13:54
Robert Ramey wrote:
> See the following changes help.
>
> Robert Ramey
>
> #define BOOST_ARCHIVE_SOURCE
>
>>> #include <rs/repository/Archive.hpp>
>>>
>>> #include <rs/repository/Repository.hpp>
>>>
>>> namespace rs
>>> {
>>>
>>> InputArchive::InputArchive( std::istream& is )
>>> : boost::archive::xml_iarchive_impl<InputArchive>( is, 0 )
>>> , m_repository( 0 )
>>> {
>>>
>>> }
>>>
>>> InputArchive::InputArchive( std::istream& is, Repository&
>>> repository ) :
>>> boost::archive::xml_iarchive_impl<InputArchive>( is, 0 ) ,
>>> m_repository( &repository ) {
>>>
>>> }
>>>
>>> Repository* InputArchive::GetRepository() const
>>> {
>>> return m_repository;
>>> }
>>>
>>> } // end namespace rs
>>>
>>> BOOST_SERIALIZATION_REGISTER_ARCHIVE( rs::InputArchive )
>>>
>>> #include <boost/archive/impl/basic_xml_iarchive.ipp>
>>> #include <boost/archive/impl/xml_iarchive_impl.ipp>
>>>
>>> namespace boost
>>> {
>>> namespace archive
>>> {
>>>
>>> template class basic_xml_iarchive<rs::InputArchive>;
>>> template class xml_iarchive_impl<rs::InputArchive>;
>>>
> template class detail::archive_pointer_iserializer<rs::InputArchive> ;
>
>
>>> } // end namespace archive
>>> } // end namespace boost
>>>
>>> #define BOOST_ARCHIVE_CUSTOM_IARCHIVE_TYPES rs::InputArchive
Thanks for the quick reply. Your suggestions got rid of some linker
errors, but there's still a few left. I've attached the updated cpp
containing your changes as well as my current linker output.
Thanks again!
Kenny Riddile
#define BOOST_ARCHIVE_SOURCE
#include <rs/repository/Archive.hpp>
#include <rs/repository/Repository.hpp>
namespace rs
{
InputArchive::InputArchive( std::istream& is )
: boost::archive::xml_iarchive_impl<InputArchive>( is, 0 )
, m_repository( 0 )
{
}
InputArchive::InputArchive( std::istream& is, Repository& repository )
: boost::archive::xml_iarchive_impl<InputArchive>( is, 0 )
, m_repository( &repository )
{
}
Repository* InputArchive::GetRepository() const
{
return m_repository;
}
} // end namespace rs
BOOST_SERIALIZATION_REGISTER_ARCHIVE( rs::InputArchive )
#include <boost/archive/impl/basic_xml_iarchive.ipp>
#include <boost/archive/impl/xml_iarchive_impl.ipp>
#include <boost/archive/impl/archive_pointer_iserializer.ipp>
namespace boost
{
namespace archive
{
template class basic_xml_iarchive<rs::InputArchive>;
template class xml_iarchive_impl<rs::InputArchive>;
template class detail::archive_pointer_iserializer<rs::InputArchive>;
} // end namespace archive
} // end namespace boost
#define BOOST_ARCHIVE_CUSTOM_IARCHIVE_TYPES rs::InputArchive
1>------ Build started: Project: repository_test_repository, Configuration: Debug Win32 ------
1>Linking...
1>repository.lib(Archive.obj) : error LNK2005: "public: bool __thiscall boost::archive::detail::basic_iserializer::serialized_as_pointer(void)const " (?serialized_as_pointer_at_basic_iserializer_at_detail@archive_at_boost@@QBE_NXZ) already defined in boost_serialization-mt-gd.lib(boost_serialization-mt-gd.dll)
1>repository.lib(Archive.obj) : error LNK2005: "public: bool __thiscall boost::archive::detail::basic_oserializer::serialized_as_pointer(void)const " (?serialized_as_pointer_at_basic_oserializer_at_detail@archive_at_boost@@QBE_NXZ) already defined in boost_serialization-mt-gd.lib(boost_serialization-mt-gd.dll)
1> Creating library C:\Documents and Settings\Administrator\My Documents\Development\development\build\bin\Debug\repository_test_repository.lib and object C:\Documents and Settings\Administrator\My Documents\Development\development\build\bin\Debug\repository_test_repository.exp
1>repository.obj : warning LNK4217: locally defined symbol ?load_end@?$basic_xml_iarchive_at_VInputArchive@rs@@@archive_at_boost@@IAEXPBD_at_Z (protected: void __thiscall boost::archive::basic_xml_iarchive<class rs::InputArchive>::load_end(char const *)) imported in function "protected: void __thiscall boost::archive::basic_xml_iarchive<class rs::InputArchive>::load_override<class TestResource>(struct boost::serialization::nvp<class TestResource> const &,int)" (??$load_override_at_VTestResource@@@?$basic_xml_iarchive_at_VInputArchive@rs@@@archive_at_boost@@IAEXABU?$nvp_at_VTestResource@@@serialization_at_2@H_at_Z)
1>repository.obj : warning LNK4217: locally defined symbol ?load_start@?$basic_xml_iarchive_at_VInputArchive@rs@@@archive_at_boost@@IAEXPBD_at_Z (protected: void __thiscall boost::archive::basic_xml_iarchive<class rs::InputArchive>::load_start(char const *)) imported in function "protected: void __thiscall boost::archive::basic_xml_iarchive<class rs::InputArchive>::load_override<class TestResource>(struct boost::serialization::nvp<class TestResource> const &,int)" (??$load_override_at_VTestResource@@@?$basic_xml_iarchive_at_VInputArchive@rs@@@archive_at_boost@@IAEXABU?$nvp_at_VTestResource@@@serialization_at_2@H_at_Z)
1>repository.obj : warning LNK4217: locally defined symbol ??1?$xml_iarchive_impl_at_VInputArchive@rs@@@archive_at_boost@@IAE_at_XZ (protected: __thiscall boost::archive::xml_iarchive_impl<class rs::InputArchive>::~xml_iarchive_impl<class rs::InputArchive>(void)) imported in function "public: __thiscall rs::InputArchive::~InputArchive(void)" (??1InputArchive_at_rs@@QAE_at_XZ)
1>repository.lib(ArchiveWrapper.obj) : warning LNK4049: locally defined symbol ??1?$xml_iarchive_impl_at_VInputArchive@rs@@@archive_at_boost@@IAE_at_XZ (protected: __thiscall boost::archive::xml_iarchive_impl<class rs::InputArchive>::~xml_iarchive_impl<class rs::InputArchive>(void)) imported
1>repository.obj : warning LNK4217: locally defined symbol ?load@?$xml_iarchive_impl_at_VInputArchive@rs@@@archive_at_boost@@IAEXAAV?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@@Z (protected: void __thiscall boost::archive::xml_iarchive_impl<class rs::InputArchive>::load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)) imported in function "public: void __thiscall rs::InputArchive::load<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (??$load_at_V?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@@InputArchive_at_rs@@QAEXAAV?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@@Z)
1>repository.lib(Archive.obj) : error LNK2019: unresolved external symbol "public: __thiscall boost::archive::basic_xml_grammar<char>::basic_xml_grammar<char>(void)" (??0?$basic_xml_grammar_at_D@archive_at_boost@@QAE_at_XZ) referenced in function "protected: __thiscall boost::archive::xml_iarchive_impl<class boost::archive::naked_xml_iarchive>::xml_iarchive_impl<class boost::archive::naked_xml_iarchive>(class std::basic_istream<char,struct std::char_traits<char> > &,unsigned int)" (??0?$xml_iarchive_impl_at_Vnaked_xml_iarchive_at_archive@boost@@@archive_at_boost@@IAE_at_AAV?$basic_istream_at_DU?$char_traits_at_D@std@@@std@@I_at_Z)
1>repository.lib(Archive.obj) : error LNK2019: unresolved external symbol "public: void __thiscall boost::archive::basic_xml_grammar<char>::windup(class std::basic_istream<char,struct std::char_traits<char> > &)" (?windup@?$basic_xml_grammar_at_D@archive_at_boost@@QAEXAAV?$basic_istream_at_DU?$char_traits_at_D@std@@@std@@@Z) referenced in function "protected: __thiscall boost::archive::xml_iarchive_impl<class boost::archive::naked_xml_iarchive>::~xml_iarchive_impl<class boost::archive::naked_xml_iarchive>(void)" (??1?$xml_iarchive_impl_at_Vnaked_xml_iarchive_at_archive@boost@@@archive_at_boost@@IAE_at_XZ)
1>repository.lib(Archive.obj) : error LNK2019: unresolved external symbol "public: bool __thiscall boost::archive::basic_xml_grammar<char>::parse_start_tag(class std::basic_istream<char,struct std::char_traits<char> > &)" (?parse_start_tag@?$basic_xml_grammar_at_D@archive_at_boost@@QAE_NAAV?$basic_istream_at_DU?$char_traits_at_D@std@@@std@@@Z) referenced in function "protected: void __thiscall boost::archive::basic_xml_iarchive<class rs::InputArchive>::load_start(char const *)" (?load_start@?$basic_xml_iarchive_at_VInputArchive@rs@@@archive_at_boost@@IAEXPBD_at_Z)
1>repository.lib(Archive.obj) : error LNK2019: unresolved external symbol "public: bool __thiscall boost::archive::basic_xml_grammar<char>::parse_end_tag(class std::basic_istream<char,struct std::char_traits<char> > &)const " (?parse_end_tag@?$basic_xml_grammar_at_D@archive_at_boost@@QBE_NAAV?$basic_istream_at_DU?$char_traits_at_D@std@@@std@@@Z) referenced in function "protected: void __thiscall boost::archive::basic_xml_iarchive<class rs::InputArchive>::load_end(char const *)" (?load_end@?$basic_xml_iarchive_at_VInputArchive@rs@@@archive_at_boost@@IAEXPBD_at_Z)
1>repository.lib(Archive.obj) : error LNK2019: unresolved external symbol "public: bool __thiscall boost::archive::basic_xml_grammar<char>::parse_string(class std::basic_istream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?parse_string@?$basic_xml_grammar_at_D@archive_at_boost@@QAE_NAAV?$basic_istream_at_DU?$char_traits_at_D@std@@@std@@AAV?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@5@@Z) referenced in function "protected: void __thiscall boost::archive::xml_iarchive_impl<class rs::InputArchive>::load(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &)" (?load@?$xml_iarchive_impl_at_VInputArchive@rs@@@archive_at_boost@@IAEXAAV?$basic_string@_WU?$char_traits@_W_at_std@@V?$allocator@_W_at_2@@std@@@Z)
1>repository.lib(Archive.obj) : error LNK2019: unresolved external symbol "public: void __thiscall boost::archive::basic_xml_grammar<char>::init(class std::basic_istream<char,struct std::char_traits<char> > &)" (?init@?$basic_xml_grammar_at_D@archive_at_boost@@QAEXAAV?$basic_istream_at_DU?$char_traits_at_D@std@@@std@@@Z) referenced in function "protected: void __thiscall boost::archive::xml_iarchive_impl<class rs::InputArchive>::init(void)" (?init@?$xml_iarchive_impl_at_VInputArchive@rs@@@archive_at_boost@@IAEXXZ)
1>C:\Documents and Settings\Administrator\My Documents\Development\development\build\bin\Debug\repository_test_repository.exe : fatal error LNK1120: 6 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\Administrator\My Documents\Development\development\build\components\libs\repository\repository_test_repository.dir\Debug\BuildLog.htm"
1>repository_test_repository - 9 error(s), 5 warning(s)
========== Build: 0 succeeded, 1 failed, 4 up-to-date, 0 skipped ==========
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