|
Boost Users : |
Subject: [Boost-users] [serialization] Undefined reference to archive_serializer_map when creating my own archive type
From: Maxime van Noppen (maxime_at_[hidden])
Date: 2010-08-06 12:55:07
Hi,
I'm trying to create my own archive type and I'm struggling with this
error message :
> $ g++ test.cc -lboost_serialization
> /tmp/cc5aW7rV.o: In function `boost::archive::detail::pointer_oserializer<sql_oarchive, internal::unit>::pointer_oserializer()':
> test.cc:(.text._ZN5boost7archive6detail19pointer_oserializerI12sql_oarchiveN8internal4unitEEC2Ev[_ZN5boost7archive6detail19pointer_oserializerI12sql_oarchiveN8internal4unitEEC5Ev]+0x4f): undefined reference to `boost::archive::detail::archive_serializer_map<sql_oarchive>::insert(boost::archive::detail::basic_serializer const*)'
> /tmp/cc5aW7rV.o: In function `boost::archive::detail::pointer_oserializer<sql_oarchive, internal::unit>::~pointer_oserializer()':
> test.cc:(.text._ZN5boost7archive6detail19pointer_oserializerI12sql_oarchiveN8internal4unitEED2Ev[_ZN5boost7archive6detail19pointer_oserializerI12sql_oarchiveN8internal4unitEED5Ev]+0x24): undefined reference to `boost::archive::detail::archive_serializer_map<sql_oarchive>::erase(boost::archive::detail::basic_serializer const*)'
I can't find the relevant part of the documentation which talks about
it. Adding this piece of code makes the code compile but it doesn't work:
> namespace boost { namespace archive { namespace detail {
> template <>
> bool archive_serializer_map<sql_oarchive>::insert(boost::archive::detail::basic_serializer const*)
> {
> // ??
> }
>
> template <>
> void archive_serializer_map<sql_oarchive>::erase(boost::archive::detail::basic_serializer const*)
> {
> // ??
> }
> } } }
I'm using boost 1.43 on g++ 4.5 on linux 64bits. The code is attached.
What am I missing ?
Thanks,
-- Maxime
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net