user1549792
user1549792

Reputation: 79

'Eigen_solver_traits' does not name a type?

I am attempting to use the example CGAL Surface Reconstruction code as detailed here, yet when I try to use this line of code:

Poisson_reconstruction_function function(points.begin(), points.end(),CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type()) );

I get this error:

/usr/local/include/CGAL/Poisson_reconstruction_function.h: In member function ‘bool CGAL::Poisson_reconstruction_function<Gt>::compute_implicit_function(bool)’:
/usr/local/include/CGAL/Poisson_reconstruction_function.h:537:13: error: ‘Eigen_solver_traits’ does not name a type
 typedef Eigen_solver_traits<Eigen::ConjugateGradient<Eigen_sparse_symmetric_matrix<double>::EigenType> > Solver;

Does anybody know why?

Upvotes: 0

Views: 465

Answers (3)

Patricio Astudillo
Patricio Astudillo

Reputation: 882

When using cmake, add the following lines to your CMakeLists file:

find_package(Eigen3 REQUIRED) include_directories( ${EIGEN3_INCLUDE_DIR} )

Upvotes: 0

user1549792
user1549792

Reputation: 79

Nevermind, fixed it by ensuring CGAL_EIGEN3_ENABLED was enabled. Thanks again however for all of the help!

Upvotes: 0

jcai
jcai

Reputation: 3593

This particular error usually means you need to add a typename. Try

typedef typename Eigen_solver_traits<Eigen::ConjugateGradient<Eigen_sparse_symmetric_matrix<double>::EigenType> > Solver;
        ^^^^^^^^

or perhaps,

typedef Eigen_solver_traits<Eigen::ConjugateGradient<typename Eigen_sparse_symmetric_matrix<double>::EigenType> > Solver;
                                                     ^^^^^^^^

Upvotes: 1

Related Questions