I am working on my assignment in which I think I can use boost.serialization library. But we are asked to use only header only version of boost. So I want to know wheather boost.serialization fall under header only version or not?
CodePudding user response:
No, it requires linking with the boost_serialization
or boost_wserialization
library.
Failing to link with the library will for the most basic demo on the boost site produce a long list of undefined references:
undefined reference to...
`boost::archive::archive_exception::~archive_exception()'
`boost::archive::archive_exception::archive_exception(boost::archive::archive_exception const&)'
`boost::archive::archive_exception::archive_exception(boost::archive::archive_exception::exception_code, char const*, char const*)'
`boost::archive::basic_text_iprimitive<std::istream>::~basic_text_iprimitive()'
`boost::archive::basic_text_oarchive<boost::archive::text_oarchive>::init()'
`boost::archive::basic_text_oarchive<boost::archive::text_oarchive>::newtoken()'
`boost::archive::basic_text_oprimitive<std::ostream>::~basic_text_oprimitive()'
`boost::archive::detail::basic_iarchive::~basic_iarchive()'
`boost::archive::detail::basic_iarchive::load_object(void*, boost::archive::detail::basic_iserializer const&)'
`boost::archive::detail::basic_iserializer::~basic_iserializer()'
`boost::archive::detail::basic_iserializer::basic_iserializer(boost::serialization::extended_type_info const&)'
`boost::archive::detail::basic_oarchive::~basic_oarchive()'
`boost::archive::detail::basic_oarchive::end_preamble()'
`boost::archive::detail::basic_oarchive::save_object(void const*, boost::archive::detail::basic_oserializer const&)'
`boost::archive::detail::basic_oserializer::~basic_oserializer()'
`boost::archive::detail::basic_oserializer::basic_oserializer(boost::serialization::extended_type_info const&)'
`boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::init()'
`boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load_override(boost::archive::class_name_type&)'
`boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::text_iarchive_impl(std::istream&, unsigned int)'
`boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
`boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::text_oarchive_impl(std::ostream&, unsigned int)'
`boost::serialization::extended_type_info::key_register() const'
`boost::serialization::extended_type_info::key_unregister() const'
`boost::serialization::typeid_system::extended_type_info_typeid_0::~extended_type_info_typeid_0()'
`boost::serialization::typeid_system::extended_type_info_typeid_0::extended_type_info_typeid_0(char const*)'
`boost::serialization::typeid_system::extended_type_info_typeid_0::is_equal(boost::serialization::extended_type_info const&) const'
`boost::serialization::typeid_system::extended_type_info_typeid_0::is_less_than(boost::serialization::extended_type_info const&) const'
`boost::serialization::typeid_system::extended_type_info_typeid_0::type_register(std::type_info const&)'
`boost::serialization::typeid_system::extended_type_info_typeid_0::type_unregister()'
`typeinfo for boost::archive::archive_exception'
`typeinfo for boost::archive::detail::basic_iarchive'
`typeinfo for boost::archive::detail::basic_iserializer'
`typeinfo for boost::archive::detail::basic_oarchive'
`typeinfo for boost::archive::detail::basic_oserializer'
`typeinfo for boost::serialization::typeid_system::extended_type_info_typeid_0'