Skip to content

nightsparc/EigenSerialize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EigenSerialize

Test repo for Eigen matrix serialization with boost

See SO for discussion and solution: https://stackoverflow.com/questions/54534047/eigen-matrix-boostserialization-c17

Somewhere in the code an Eigen type-trait gets instantiated which tries to access an incomplete type of boost::serialization. Totally strang. Works with C++11/14...??!

usr/local/include/Eigen/src/Core/util/ForwardDeclarations.h:32:
error: incomplete type ‘Eigen::internal::traits<boost::serialization::U>’ used in nested name specifier
enum { has_direct_access = (traits<Derived>::Flags & DirectAccessBit) ? 1 : 0,

The error occures whenever boost/serialization/shared_ptr.hpp is included - regardless if a shared_ptr is serialized or not. See line 15 in the main.cpp:

#include <boost/serialization/shared_ptr.hpp>

To compile use:

  • G++: g++-7 -std=c++17 -o main.o main.cpp -lboost_serialization
  • Clang: clang -std=c++17 -o main.o main.cpp -lboost_serialization -lstdc++

Seems to be compiler-related:

  • GCC7/8 failes with the mesage above (regardless if --std=c++17 or --std=c++20)
  • GCC6 works with --std=c++17
  • Clang6 works with --std=c++17

About

Test repo for Eigen matrix serialization with boost

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published