boost库序列化不工作

boost库序列化不工作,boost,Boost,我使用macports下载并安装boost lib,没有任何问题 我试着从他们的网站上运行代码,得到了以下新颖的结果: 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::exten

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

我试着从他们的网站上运行代码,得到了以下新颖的结果:

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]
g++-o VectorSjov Main.o utunity/math/vector/Vec2d.cpp
架构x86_64的未定义符号:
“boost::serialization::void_upcast(boost::serialization::extended_type_info const&,boost::serialization::extended_type_info const&,void const*)”,引用自:
Main.o中的bus_-stop*boost::archive::detail::load_-pointer\u type::pointer\u tweak(boost::serialization::extended_-type\u-info-const&、void-const*、bus\u-stop-const&)
在Main.o中加载指针类型指针调整(boost::序列化::扩展指针类型信息常量&,void常量*,总线路由常量&)
“boost::serialization::typeid_system::extended_type_info_typeid_0::type_register(std::type_info const&)”,引用自:
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
...
“boost::serialization::typeid_system::extended_type_info_typeid_0::type_unregister()”,引用自:
boost::serialization::extended_type_info_typeid::~ Main.o中的extended_type_info_typeid()
boost::serialization::extended_type_info_typeid::~ Main.o中的extended_type_info_typeid()
boost::serialization::extended_type_info_typeid::~ Main.o中的extended_type_info_typeid()
boost::serialization::extended_type_info_typeid::~ Main.o中的extended_type_info_typeid()
boost::serialization::extended_type_info_typeid::~ Main.o中的extended_type_info_typeid()
boost::serialization::extended_type_info_typeid::~ Main.o中的extended_type_info_typeid()
boost::serialization::extended_type_info_typeid::~ Main.o中的extended_type_info_typeid()
...
“boost::serialization::typeid_system::extended_type_info_typeid_0::extended_type_info_typeid_0(char const*)”,引用自:
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
...
“boost::serialization::typeid_system::extended_type_info_typeid_0::~ extended_type_info_typeid_0()”,引用自:
boost::serialization::extended_type_info_typeid::~ Main.o中的extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
boost::serialization::extended_type_info_typeid::~ Main.o中的extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
boost::serialization::extended_type_info_typeid::~ Main.o中的extended_type_info_typeid()
Main.o中的boost::serialization::extended_type_info_typeid::extended_type_info_typeid()
boost::serialization::extended_type_info_typeid::~ Main.o中的extended_type_info_typeid()
...
“boost::serialization::void_downcast(boost::serialization::extended_type_info const&,boost::serialization::extended_type_info const&,void const*)”,引用自:
void boost::archive::detail::save\u pointer\u type::polymorphic::save(boost::archive::text\u oarchive&,bus\u stop&)在Main.o中
“boost::archive::archive_exception::archive_exception(boost::archive::archive_exception::exception_code,char const*,char const*)”,引用自:
void boost::archive::basic_text_iprimitive::在Main.o中加载(unsigned int&)
void boost::archive::basic_text_iprimitive::load(boost::serialization::collection_size_type&)在Main.o中
void boost::archive::basic_text_iprimitive::在Main.o中加载(float&)
void boost::archive::basic_text_iprimitive::在Main.o中加载(int&)
void boost::archive::detail::save\u pointer\u type::polymorphic::save(boost::archive::text\u oarchive&,bus\u stop&)在Main.o中
void boost::archive::basic_text_oprimitive::在Main.o中保存(unsigned int const&)
void boost::archive::basic\u text\u oprimitive::save(boost::serialization::collection\u size\u type const&)在Main.o中
...
“boost::archive::archive_exception::~archive_exception()”,引用自:
void boost::archive::basic_text_iprimitive::在Main.o中加载(unsigned int&)
void boost::serialization::在Main.o中抛出异常(boost::archive::archive\u exception const&)
void boost::archive::basic_text_iprimitive::load(boost::serialization::collection_size_type&)在Main.o中
void boost::archive::basic_text_iprimitive::在Main.o中加载(float&)
void boost::archive::basic_text_iprimitive::在Main.o中加载(int&)
void boost::archive::detail::save\u pointer\u type::polymorphic::save(boost::archive::text\u oarchive&,bus\u stop&)在Main.o中
void boost::archive::basic_text_oprimitive::在Main.o中保存(unsigned int const&)
...
“boost::archive::text\u iarchive\u impl::load\u override(boost::archive::class\u name\u type&,int)”,引用自:
boost::archive::text\u iarchive&boost::archive::detail::interface\u iarchive::operator>>(boost
> Undefined symbols for architecture x86_64