提升库序列化不起作用

编程入门 行业动态 更新时间:2024-10-24 02:28:16
本文介绍了提升库序列化不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用macports来下载并安装boost lib,没有任何问题.

I used macports to download and install boost lib without any problems.

我试图从他们的网站上运行代码,并获得了以下小说:

I tried to run the code from their website and got the following novel:

c ++ -c -o Main.o Main.cpp

c++ -c -o Main.o Main.cpp

正在编译...

g++ -o VectorSjov Main.o utunity/math/vector/Vec2d.cpp Undefined symbols for architecture x86_64: "boost::serialization::void_upcast(boost::serialization::extended_type_info const&, boost::serialization::extended_type_info const&, void const*)", referenced from: bus_stop* boost::archive::detail::load_pointer_type<boost::archive::text_iarchive>::pointer_tweak<bus_stop>(boost::serialization::extended_type_info const&, void const*, bus_stop const&)in Main.o bus_route* boost::archive::detail::load_pointer_type<boost::archive::text_iarchive>::pointer_tweak<bus_route>(boost::serialization::extended_type_info const&, void const*, bus_route const&)in Main.o "boost::serialization::typeid_system::extended_type_info_typeid_0::type_register(std::type_info const&)", referenced from: boost::serialization::extended_type_info_typeid<std::list<bus_stop*, std::allocator<bus_stop*> > >::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_stop_destination>::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<gps_position>::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_stop>::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_stop_corner>::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_route>::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_schedule::trip_info>::extended_type_info_typeid()in Main.o ... "boost::serialization::typeid_system::extended_type_info_typeid_0::type_unregister()", referenced from: boost::serialization::extended_type_info_typeid<std::list<bus_stop*, std::allocator<bus_stop*> > >::~extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_stop_destination>::~extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<gps_position>::~extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_stop>::~extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_stop_corner>::~extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_route>::~extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_schedule::trip_info>::~extended_type_info_typeid()in Main.o ... "boost::serialization::typeid_system::extended_type_info_typeid_0::extended_type_info_typeid_0(char const*)", referenced from: boost::serialization::extended_type_info_typeid<std::list<bus_stop*, std::allocator<bus_stop*> > >::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_stop_destination>::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<gps_position>::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_stop>::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_stop_corner>::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_route>::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_schedule::trip_info>::extended_type_info_typeid()in Main.o ... "boost::serialization::typeid_system::extended_type_info_typeid_0::~extended_type_info_typeid_0()", referenced from: boost::serialization::extended_type_info_typeid<std::list<bus_stop*, std::allocator<bus_stop*> > >::~extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<std::list<bus_stop*, std::allocator<bus_stop*> > >::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_stop_destination>::~extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_stop_destination>::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<gps_position>::~extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<gps_position>::extended_type_info_typeid()in Main.o boost::serialization::extended_type_info_typeid<bus_stop>::~extended_type_info_typeid()in Main.o ... "boost::serialization::void_downcast(boost::serialization::extended_type_info const&, boost::serialization::extended_type_info const&, void const*)", referenced from: void boost::archive::detail::save_pointer_type<boost::archive::text_oarchive>::polymorphic::save<bus_stop>(boost::archive::text_oarchive&, bus_stop&)in Main.o "boost::archive::archive_exception::archive_exception(boost::archive::archive_exception::exception_code, char const*, char const*)", referenced from: void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<unsigned int>(unsigned int&)in Main.o void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<boost::serialization::collection_size_type>(boost::serialization::collection_size_type&)in Main.o void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<float>(float&)in Main.o void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<int>(int&)in Main.o void boost::archive::detail::save_pointer_type<boost::archive::text_oarchive>::polymorphic::save<bus_stop>(boost::archive::text_oarchive&, bus_stop&)in Main.o void boost::archive::basic_text_oprimitive<std::basic_ostream<char, std::char_traits<char> > >::save<unsigned int>(unsigned int const&)in Main.o void boost::archive::basic_text_oprimitive<std::basic_ostream<char, std::char_traits<char> > >::save<boost::serialization::collection_size_type>(boost::serialization::collection_size_type const&)in Main.o ... "boost::archive::archive_exception::~archive_exception()", referenced from: void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<unsigned int>(unsigned int&)in Main.o void boost::serialization::throw_exception<boost::archive::archive_exception>(boost::archive::archive_exception const&)in Main.o void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<boost::serialization::collection_size_type>(boost::serialization::collection_size_type&)in Main.o void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<float>(float&)in Main.o void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<int>(int&)in Main.o void boost::archive::detail::save_pointer_type<boost::archive::text_oarchive>::polymorphic::save<bus_stop>(boost::archive::text_oarchive&, bus_stop&)in Main.o void boost::archive::basic_text_oprimitive<std::basic_ostream<char, std::char_traits<char> > >::save<unsigned int>(unsigned int const&)in Main.o ... "boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load_override(boost::archive::class_name_type&, int)", referenced from: boost::archive::text_iarchive& boost::archive::detail::interface_iarchive<boost::archive::text_iarchive>::operator>><boost::archive::class_name_type>(boost::archive::class_name_type&)in Main.o "boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)", referenced from: void boost::archive::load_access::load_primitive<boost::archive::text_iarchive, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(boost::archive::text_iarchive&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)in Main.o "boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::text_iarchive_impl(std::basic_istream<char, std::char_traits<char> >&, unsigned int)", referenced from: boost::archive::text_iarchive::text_iarchive(std::basic_istream<char, std::char_traits<char> >&, unsigned int)in Main.o "boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from: void boost::archive::save_access::save_primitive<boost::archive::text_oarchive, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(boost::archive::text_oarchive&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in Main.o .... bus_stop_corner>in Main.o typeinfo for boost::archive::detail::oserializer<boost::archive::text_oarchive, bus_route>in Main.o typeinfo for boost::archive::detail::oserializer<boost::archive::text_oarchive, bus_schedule::trip_info>in Main.o ... "typeinfo for boost::archive::detail::basic_pointer_iserializer", referenced from: typeinfo for boost::archive::detail::pointer_iserializer<boost::archive::text_iarchive, bus_route>in Main.o typeinfo for boost::archive::detail::pointer_iserializer<boost::archive::text_iarchive, bus_stop_destination>in Main.o typeinfo for boost::archive::detail::pointer_iserializer<boost::archive::text_iarchive, bus_stop_corner>in Main.o "typeinfo for boost::archive::detail::basic_pointer_oserializer", referenced from: typeinfo for boost::archive::detail::pointer_oserializer<boost::archive::text_oarchive, bus_route>in Main.o typeinfo for boost::archive::detail::pointer_oserializer<boost::archive::text_oarchive, bus_stop_destination>in Main.o typeinfo for boost::archive::detail::pointer_oserializer<boost::archive::text_oarchive, bus_stop_corner>in Main.o "vtable for boost::archive::archive_exception", referenced from: boost::archive::archive_exception::archive_exception(boost::archive::archive_exception const&)in Main.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status make: *** [VectorSjov] Error 1 [Finished in 3.1s with exit code 2]

好吗? :D

推荐答案

不要忘记链接以增强序列化,它不是仅标头库.

Don't forget to link to boost serialization, it's not header-only library.

更多推荐

提升库序列化不起作用

本文发布于:2023-08-04 06:00:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1293591.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不起作用   序列化

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!