
I'm having a bit of trouble using boost.serialization with a std::map. It seems like there is something simple I'm not doing correctly. I'm hoping someone can point me in the right direction. Thanks, David K. I'm using VS2005. Here is my test code: #include <map> #include <fstream> #include "boost/serialization/map.hpp" #include "boost/archive/xml_oarchive.hpp" std::map<int, int> map1; int main(int argc, char**argv) { map1[1] = 100; std::ofstream os("out.xml"); boost::archive::xml_oarchive oa(os); oa << BOOST_SERIALIZATION_NVP(map1); } This is the error: ...boost-win32-1_33_1\include\boost\archive\detail\oserializer.hpp(131) : error C2027: use of undefined type 'boost::serialization::extended_type_info_null<T>' with [ T=std::map<int,int> ] ...boost-win32-1_33_1\include\boost\archive\detail\oserializer.hpp(128) : while compiling class template member function 'bool boost::archive::detail::oserializer<Archive,T>::is_polymorphic(void) const' with [ Archive=boost::archive::xml_oarchive, T=std::map<int,int> ] ...boost-win32-1_33_1\include\boost\archive\detail\oserializer.hpp(264) : see reference to class template instantiation 'boost::archive::detail::oserializer<Archive,T>' being compiled with [ Archive=boost::archive::xml_oarchive, T=std::map<int,int> ] ...boost-win32-1_33_1\include\boost\archive\detail\oserializer.hpp(263) : while compiling class template member function 'void boost::archive::detail::save_non_pointer_type<Archive,T>::save_standard::invoke(Archive &,const T &)' with [ Archive=boost::archive::xml_oarchive, T=std::map<int,int> ] ...boost-win32-1_33_1\include\boost\archive\detail\oserializer.hpp(322) : see reference to class template instantiation 'boost::archive::detail::save_non_pointer_type<Archive,T>::save_standard' being compiled with [ Archive=boost::archive::xml_oarchive, T=std::map<int,int> ] ...boost-win32-1_33_1\include\boost\archive\detail\oserializer.hpp(310) : while compiling class template member function 'void boost::archive::detail::save_non_pointer_type<Archive,T>::invoke(Archive &,const T &)' with [ Archive=boost::archive::xml_oarchive, T=std::map<int,int> ] ...boost-win32-1_33_1\include\boost\archive\detail\oserializer.hpp(536) : see reference to class template instantiation 'boost::archive::detail::save_non_pointer_type<Archive,T>' being compiled with [ Archive=boost::archive::xml_oarchive, T=std::map<int,int> ] ...boost-win32-1_33_1\include\boost\archive\basic_xml_oarchive.hpp(99) : see reference to function template instantiation 'void boost::archive::save<Archive,T>(Archive &,const T &)' being compiled with [ Archive=boost::archive::xml_oarchive, T=std::map<int,int> ] ...boost-win32-1_33_1\include\boost\archive\detail\interface_oarchive.hpp(78) : see reference to function template instantiation 'void boost::archive::basic_xml_oarchive<Archive>::save_override<std::map<_Kty,_Ty>>(const boost::serialization::nvp<T> &,int)' being compiled with [ Archive=boost::archive::xml_oarchive, _Kty=int, _Ty=int, T=std::map<int,int> ] ...\source1.cpp(14) : see reference to function template instantiation 'Archive &boost::archive::detail::interface_oarchive<Archive>::operator <<<const boost::serialization::nvp<T>>(const boost::serialization::nvp<T> &)' being compiled with [ Archive=boost::archive::xml_oarchive, T=std::map<int,int> ]

I'm having a bit of trouble using boost.serialization with a std::map. It seems like there is something simple I'm not doing correctly. I'm hoping someone can point me in the right direction. Thanks, David K.
I'm using VS2005. Here is my test code:
#include <map> #include <fstream>
//need include any archive files before serialization #include "boost/archive/xml_oarchive.hpp" #include "boost/serialization/map.hpp" ___________________________________________________ http://www.bigmir.net - поиск по украинским сайтам

Hi David, David Kantowitz wrote:
I'm having a bit of trouble using boost.serialization with a std::map. It seems like there is something simple I'm not doing correctly. I'm hoping someone can point me in the right direction. [...]
#include <map> #include <fstream> #include "boost/serialization/map.hpp" #include "boost/archive/xml_oarchive.hpp"
[...]
This is the error:
...boost-win32-1_33_1\include\boost\archive\detail\oserializer.hpp(131) : error C2027: use of undefined type 'boost::serialization::extended_type_info_null<T>' with [ T=std::map<int,int> ]
This error indicated header ordering problems in my use cases. Try moving the two serialization headers to the top. Best regards, Wolfgang

Wolfgang, Александр, Thank-you. That fixed my problem. Best Regards, David K. On 4/11/07, Wolfgang Baer <w.baer@yahoo.de> wrote:
Hi David,
David Kantowitz wrote:
I'm having a bit of trouble using boost.serialization with a std::map. It seems like there is something simple I'm not doing correctly. I'm hoping someone can point me in the right direction. [...]
#include <map> #include <fstream> #include "boost/serialization/map.hpp" #include "boost/archive/xml_oarchive.hpp"
[...]
This is the error:
...boost-win32-1_33_1\include\boost\archive\detail\oserializer.hpp(131) : error C2027: use of undefined type 'boost::serialization::extended_type_info_null<T>' with [ T=std::map<int,int> ]
This error indicated header ordering problems in my use cases. Try moving the two serialization headers to the top.
Best regards, Wolfgang _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
David Kantowitz
-
Wolfgang Baer
-
Александр