This is from a previous email sent by my colleague…

 

OS: Red Hat 6
Compiler: GCC 5.3

I installed from a source distribution and the root paths are $HOME/packages/boost/v1_61/include/1_61 for the include path and $HOME/packages/boost/v1_61/lib/gnu-5.3 for the library path. My compilation command is

g++ -o demo -I. -I$HOME/packages/boost/v1_61/include/1_61 demo.cpp -L$HOME/packages/boost/v1_61/lib/gnu-5.3 -lboost_serialization-gcc53-1_61

and these are the link errors

/tmp/ccFM57HA.o: In function `boost::archive::text_iarchive::text_iarchive(std::istream&, unsigned int)':
demo.cpp:(.text._ZN5boost7archive13text_iarchiveC2ERSij[_ZN5boost7archive13text_iarchiveC5ERSij]+0x36): undefined reference to `boost::archive::detail::shared_ptr_helper::shared_ptr_helper()'
/tmp/ccFM57HA.o: In function `boost::archive::text_iarchive::~text_iarchive()':
demo.cpp:(.text._ZN5boost7archive13text_iarchiveD2Ev[_ZN5boost7archive13text_iarchiveD5Ev]+0x25): undefined reference to `boost::archive::detail::shared_ptr_helper::~shared_ptr_helper()'
/tmp/ccFM57HA.o: In function `void boost::archive::detail::load_pointer_type<boost::archive::text_iarchive>::invoke<bus_route*>(boost::archive::text_iarchive&, bus_route*&)':
demo.cpp:(.text._ZN5boost7archive6detail17load_pointer_typeINS0_13text_iarchiveEE6invokeIP9bus_routeEEvRS3_RT_[_ZN5boost7archive6detail17load_pointer_typeINS0_13text_iarchiveEE6invokeIP9bus_routeEEvRS3_RT_]+0x56): undefined reference to `boost::archive::detail::basic_iarchive::load_pointer(void*&, boost::archive::detail::basic_pointer_iserializer const*)'
/tmp/ccFM57HA.o: In function `void boost::archive::detail::load_pointer_type<boost::archive::text_iarchive>::invoke<bus_stop*>(boost::archive::text_iarchive&, bus_stop*&)':
demo.cpp:(.text._ZN5boost7archive6detail17load_pointer_typeINS0_13text_iarchiveEE6invokeIP8bus_stopEEvRS3_RT_[_ZN5boost7archive6detail17load_pointer_typeINS0_13text_iarchiveEE6invokeIP8bus_stopEEvRS3_RT_]+0x56): undefined reference to `boost::archive::detail::basic_iarchive::load_pointer(void*&, boost::archive::detail::basic_pointer_iserializer const*)'
/tmp/ccFM57HA.o: In function `boost::archive::text_iarchive& boost::archive::detail::interface_iarchive<boost::archive::text_iarchive>::operator>><boost::archive::class_name_type>(boost::archive::class_name_type&)':
demo.cpp:(.text._ZN5boost7archive6detail18interface_iarchiveINS0_13text_iarchiveEErsINS0_15class_name_typeEEERS3_RT_[_ZN5boost7archive6detail18interface_iarchiveINS0_13text_iarchiveEErsINS0_15class_name_typeEEERS3_RT_]+0x2f): undefined reference to `boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load_override(boost::archive::class_name_type&, int)'
collect2: error: ld returned 1 exit status

 I am at a loss why this will not build successfully. Any help would be appreciated.