diff --git a/src/angle-axis.cpp b/src/angle-axis.cpp
index 94c673b7512e66ed94b4b2c4580f141a467f9bc5..14f98546a6c7d6f3bfa836fdeccf4170bcd71692 100644
--- a/src/angle-axis.cpp
+++ b/src/angle-axis.cpp
@@ -14,9 +14,12 @@
  * with eigenpy.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "eigenpy/memory.hpp"
 #include "eigenpy/geometry.hpp"
 #include "eigenpy/angle-axis.hpp"
 
+EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(Eigen::AngleAxisd)
+
 namespace eigenpy
 {
   void exposeAngleAxis()
diff --git a/src/quaternion.cpp b/src/quaternion.cpp
index 8bbdf04c0905f0cbe7f765ba19ac29f6a39943b2..3b472fae81cd516f800cd590a34a46a135fc72c3 100644
--- a/src/quaternion.cpp
+++ b/src/quaternion.cpp
@@ -14,9 +14,12 @@
  * with eigenpy.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "eigenpy/memory.hpp"
 #include "eigenpy/geometry.hpp"
 #include "eigenpy/quaternion.hpp"
 
+EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(Eigen::Quaterniond)
+
 namespace eigenpy
 {
   void exposeQuaternion()