boost::serialization: 'serialize' is not a member of 'Eigen::internal::workaround_msvc_stl_support<T>'
Boost 1.50 MSVS 2010 My problem occurs when I attempt to serialize pcl::PointCloud<pcl::PointXYZ> g...specifically g.points which is std::vector<Point, Eigen::aligned_allocator<Point> > pcl::PointCloud<Point>::points. I have the following code: #ifndef SERIALIZATIONSUPPORT_H #define SERIALIZATIONSUPPORT_H #include <pcl/point_cloud.h> #include <pcl/io/pcd_io.h> #include <pcl/point_types.h> // needed for pcl::PointXYZ Point #include <boost/serialization/base_object.hpp> #include <boost/serialization/utility.hpp> #include <boost/serialization/list.hpp> #include <boost/serialization/assume_abstract.hpp> #include <boost/serialization/vector.hpp> typedef pcl::PointXYZ Point; namespace boost { namespace serialization { template<class Archive> void serialize(Archive & ar, pcl::PointCloud<Point>& g, const unsigned int version) { ar & g.points; } template<class Archive> void serialize(Archive & ar, Point& g, const unsigned int version) { ar & g.getVector3fMap().data()[0]; ar & g.getVector3fMap().data()[1]; ar & g.getVector3fMap().data()[2]; } } // namespace serialization } // namespace boost #endif /* SERIALIZATIONSUPPORT_H */ Error received: error C2039: 'serialize' : is not a member of 'Eigen::internal::workaround_msvc_stl_support<T>' Special notes...no problems with my code when compiling on Ubuntu 12.04 LTS using Boost 1.48. Only a problem when compiling on Windows. Any idea as to why I would be receiving this? I already have a method for serializing Point. Shouldn't that be enough? -- View this message in context: http://boost.2283326.n4.nabble.com/boost-serialization-serialize-is-not-a-me... Sent from the Boost - Users mailing list archive at Nabble.com.
consider ar && g.points What type is g.points ? If it's an stl collection of some sort, it's already supported. If it's something else - perhaps part of msvc workaround, then THAT will have to have serialization defined. So look in to point_cloud.h and see the type of g.points is. Robert Ramey -- View this message in context: http://boost.2283326.n4.nabble.com/boost-serialization-serialize-is-not-a-me... Sent from the Boost - Users mailing list archive at Nabble.com.
As mentioned in the original post: g.points is std::vector<Point, Eigen::aligned_allocator<Point> > pcl::PointCloud<Point>::points I include #include <boost/serialization/vector.hpp> so that handles the vector part and I created a serialize function for the Point: template<class Archive> void serialize(Archive & ar, Point& g, const unsigned int version) { ar & g.getVector3fMap().data()[0]; ar & g.getVector3fMap().data()[1]; ar & g.getVector3fMap().data()[2]; } Shouldn't that be enough. -- View this message in context: http://boost.2283326.n4.nabble.com/boost-serialization-serialize-is-not-a-me... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
LynnC
-
Robert Ramey