I want to use boost::serialization in my iOS / Android game (cocos2d-x game engine). I'm mainly working with Xcode and compiling for Android via a script.
I just tried to just include the whole boost folder (all headers) into my Xcode project and just run a very easy serialization sample. Though this resulted in linker errors, the linker being unable to find certain things:
> Undefined symbols for architecture x86_64:
> "boost::archive::archive_exception::archive_exception(boost::archive::archive_exception::exception_code,
> char const*, char const*)", referenced from:
> void boost::archive::basic_text_oprimitive<std::__1::basic_ostream<char,
> std::__1::char_traits<char> > >::save_impl<unsigned int>(unsigned int
> const&, mpl_::bool_<false>&) in Test.o
> void boost::archive::basic_text_oprimitive<std::__1::basic_ostream<char,
> std::__1::char_traits<char> >
> >::save_impl<boost::archive::object_id_type>(boost::archive::object_id_type
> const&, mpl_::bool_<false>&) in Test.o
> void boost::archive::basic_text_oprimitive<std::__1::basic_ostream<char,
> std::__1::char_traits<char> >
> >::save_impl<boost::archive::object_reference_type>(boost::archive::object_reference_type
> const&, mpl_::bool_<false>&) in Test.o
> void boost::archive::basic_text_oprimitive<std::__1::basic_ostream<char,
> std::__1::char_traits<char> >
> >::save_impl<boost::archive::class_id_type>(boost::archive::class_id_type
> const&, mpl_::bool_<false>&) in Test.o
> void boost::archive::basic_text_oprimitive<std::__1::basic_ostream<char,
> std::__1::char_traits<char> >
> >::save_impl<boost::archive::class_id_reference_type>
and so on.
The language dialect in Xcode is set to C++11 [-std=c++11]
Is it possible to just build the needed parts of boost from source? I believed that this would result in the smallest binary size and the least hassle, but unfortunately it's not even compiling.
For our app it's very important that including the boost library doesn't increase our binary size by much.
What do I need to do to make boost::serialization work?
Aucun commentaire:
Enregistrer un commentaire