Boost logo

Boost Users :

Subject: [Boost-users] [Serialization] Problem with compiling (something about assertion)
From: Mailing Lists Controller (lists_at_[hidden])
Date: 2010-07-07 12:49:22


Hi, I'm new to this list.
I tried to search something related to my problem but I found nothing
(or at least, nothing I guess it's related to my problem) and, sincerly,
I don't really know what to search for.
I excuse if I made an already solved request.

Anyway I have this problem:
I'm trying to compile the demo_xml.cpp from the Serialization tutorial.
I compiled the libraries with bjam, I use gcc 3.4.5 on MinGW 5.1.6
(windows 7).
I use Eclipse 3.5 as IDE.

I compiled and runned perfectly the text_archive version of the tutorial
but if I include xml_iarchive.hpp or xml_oarchive.hpp I get the
following error:

===========================================Start=========================================
**** Build of configuration Debug for project TestVariBoost ****

**** Internal Builder is used for build ****
g++ -IC:\Users\blueangel\workspace\TestVariBoost\include -IC:\Program
Files\boost/include -O0 -g3 -Wall -c -fmessage-length=0 -osrc\demo_xml.o
..\src\demo_xml.cpp
C:/Program Files/boost/include/boost/archive/basic_xml_oarchive.hpp: In
member function `void
boost::archive::basic_xml_oarchive<Archive>::save_override(T&, int)
[with T = const std::list<std::pair<bus_schedule::trip_info,
bus_route*>, std::allocator<std::pair<bus_schedule::trip_info,
bus_route*> > >, Archive = boost::archive::xml_oarchive]':
C:/Program
Files/boost/include/boost/archive/detail/interface_oarchive.hpp:63:
instantiated from `Archive&
boost::archive::detail::interface_oarchive<Archive>::operator<<(T&)
[with T = const std::list<std::pair<bus_schedule::trip_info,
bus_route*>, std::allocator<std::pair<bus_schedule::trip_info,
bus_route*> > >, Archive = boost::archive::xml_oarchive]'
C:/Program
Files/boost/include/boost/archive/detail/interface_oarchive.hpp:71:
instantiated from `Archive&
boost::archive::detail::interface_oarchive<Archive>::operator&(T&) [with
T = std::list<std::pair<bus_schedule::trip_info, bus_route*>,
std::allocator<std::pair<bus_schedule::trip_info, bus_route*> > >,
Archive = boost::archive::xml_oarchive]'
..\src\demo_gps.hpp:271: instantiated from `void
bus_schedule::serialize(Archive&, unsigned int) [with Archive =
boost::archive::xml_oarchive]'
C:/Program Files/boost/include/boost/serialization/access.hpp:118:
instantiated from `static void
boost::serialization::access::serialize(Archive&, T&, unsigned int)
[with Archive = boost::archive::xml_oarchive, T = bus_schedule]'
C:/Program
Files/boost/include/boost/serialization/serialization.hpp:74:
instantiated from `void boost::serialization::serialize(Archive&, T&,
unsigned int) [with Archive = boost::archive::xml_oarchive, T =
bus_schedule]'
C:/Program
Files/boost/include/boost/serialization/serialization.hpp:133:
instantiated from `void boost::serialization::serialize_adl(Archive&,
T&, unsigned int) [with Archive = boost::archive::xml_oarchive, T =
bus_schedule]'
C:/Program
Files/boost/include/boost/archive/detail/oserializer.hpp:148:
instantiated from `void boost::archive::detail::oserializer<Archive,
T>::save_object_data(boost::archive::detail::basic_oarchive&, const
void*) const [with Archive = boost::archive::xml_oarchive, T =
bus_schedule]'
..\src\demo_xml.cpp:277: instantiated from here
C:/Program Files/boost/include/boost/archive/basic_xml_oarchive.hpp:92:
error: no matching function for call to
`assertion_failed(mpl_::failed************boost::serialization::is_wrapper<const
std::list<std::pair<bus_schedule::trip_info, bus_route*>,
std::allocator<std::pair<bus_schedule::trip_info, bus_route*> > >
>::************)'
C:/Program Files/boost/include/boost/archive/basic_xml_oarchive.hpp:92:
error: enumerator value for `mpl_assertion_in_line_92' not integer constant
Build error occurred, build is stopped
Time consumed: 1263 ms.
============================================End=========================================

Really I don't understand which assertion I fail at compile time. At
line 92 of basic_xml_oarchive.hpp a comment say that most probably the
variable to be serialized the to be around a nvp wrapper but the demo do
that (this way: "oa << BOOST_SERIALIZATION_NVP(s);").

What else can it be?
Thank you for your time.


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