From 8bba418c23df2d75428082e7f452e44c3f5c018c Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <jmirabel@laas.fr>
Date: Mon, 7 Dec 2020 12:15:12 +0100
Subject: [PATCH] [Serialization] Fix usage of BOOST_CLASS_EXPORT

---
 include/hpp/manipulation/constraint-set.hh | 2 ++
 include/hpp/manipulation/device.hh         | 3 +++
 include/hpp/manipulation/serialization.hh  | 5 +++++
 src/constraint-set.cc                      | 2 +-
 src/device.cc                              | 2 +-
 src/serialization.cc                       | 8 ++++----
 6 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/include/hpp/manipulation/constraint-set.hh b/include/hpp/manipulation/constraint-set.hh
index baced7df..3f55b80f 100644
--- a/include/hpp/manipulation/constraint-set.hh
+++ b/include/hpp/manipulation/constraint-set.hh
@@ -84,4 +84,6 @@ namespace hpp {
   } // namespace manipulation
 } // namespace hpp
 
+BOOST_CLASS_EXPORT_KEY(hpp::manipulation::ConstraintSet)
+
 #endif // HPP_MANIPULATION_CONSTRAINT_SET_HH
diff --git a/include/hpp/manipulation/device.hh b/include/hpp/manipulation/device.hh
index 95059c46..18419973 100644
--- a/include/hpp/manipulation/device.hh
+++ b/include/hpp/manipulation/device.hh
@@ -97,4 +97,7 @@ namespace hpp {
     }; // class Device
   } // namespace manipulation
 } // namespace hpp
+
+BOOST_CLASS_EXPORT_KEY(hpp::manipulation::Device)
+
 #endif // HPP_MANIPULATION_DEVICE_HH
diff --git a/include/hpp/manipulation/serialization.hh b/include/hpp/manipulation/serialization.hh
index 181ca289..f53e1f58 100644
--- a/include/hpp/manipulation/serialization.hh
+++ b/include/hpp/manipulation/serialization.hh
@@ -41,6 +41,11 @@ struct archive_graph_wrapper {
 } // namespace manipulation
 } // namespace hpp
 
+BOOST_CLASS_EXPORT_KEY(hpp::manipulation::RoadmapNode)
+BOOST_CLASS_EXPORT_KEY(hpp::manipulation::LeafConnectedComp)
+BOOST_CLASS_EXPORT_KEY(hpp::manipulation::WeighedLeafConnectedComp)
+BOOST_CLASS_EXPORT_KEY(hpp::manipulation::Roadmap)
+
 namespace boost {
 namespace serialization {
 template<class Archive>
diff --git a/src/constraint-set.cc b/src/constraint-set.cc
index 29270ee1..eade2e80 100644
--- a/src/constraint-set.cc
+++ b/src/constraint-set.cc
@@ -93,4 +93,4 @@ namespace hpp {
   } // namespace manipulation
 } // namespace hpp
 
-BOOST_CLASS_EXPORT(hpp::manipulation::ConstraintSet)
+BOOST_CLASS_EXPORT_IMPLEMENT(hpp::manipulation::ConstraintSet)
diff --git a/src/device.cc b/src/device.cc
index e5c8541e..6015df4e 100644
--- a/src/device.cc
+++ b/src/device.cc
@@ -160,4 +160,4 @@ namespace hpp {
   } // namespace pinocchio
 } // namespace hpp
 
-BOOST_CLASS_EXPORT(hpp::manipulation::Device)
+BOOST_CLASS_EXPORT_IMPLEMENT(hpp::manipulation::Device)
diff --git a/src/serialization.cc b/src/serialization.cc
index cc33d04c..43da8545 100644
--- a/src/serialization.cc
+++ b/src/serialization.cc
@@ -29,10 +29,10 @@
 #include <hpp/manipulation/roadmap.hh>
 #include <hpp/manipulation/serialization.hh>
 
-BOOST_CLASS_EXPORT(hpp::manipulation::RoadmapNode)
-BOOST_CLASS_EXPORT(hpp::manipulation::LeafConnectedComp)
-BOOST_CLASS_EXPORT(hpp::manipulation::WeighedLeafConnectedComp)
-BOOST_CLASS_EXPORT(hpp::manipulation::Roadmap)
+BOOST_CLASS_EXPORT_IMPLEMENT(hpp::manipulation::RoadmapNode)
+BOOST_CLASS_EXPORT_IMPLEMENT(hpp::manipulation::LeafConnectedComp)
+BOOST_CLASS_EXPORT_IMPLEMENT(hpp::manipulation::WeighedLeafConnectedComp)
+BOOST_CLASS_EXPORT_IMPLEMENT(hpp::manipulation::Roadmap)
 
 namespace hpp {
 namespace manipulation {
-- 
GitLab