[eigen] XprHelper.h(248): fatal error C1001: An internal error has occurred in the compiler |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Hello,
I am currently integrating CGAL into an existing Visual Studio project.
For the surface reconstruct component it was necessary to use eigen.
While compiling I get the following error:
....
2> SurfaceReconstructScreen.cpp
2>d:\projects\deploy-x64\eigen\eigen\src/Core/util/XprHelper.h(248):
fatal error C1001: An internal error has occurred in the compiler.
2> (compiler file 'msc1.cpp', line 1443)
2> To work around this problem, try simplifying or changing the
program near the locations listed above.
2> Please choose the Technical Support command on the Visual C++
2> Help menu, or open the Technical Support help file for more information
2> d:\projects\deploy-x64\eigen\eigen\src/Core/util/XprHelper.h(249) :
see reference to class template instantiation
'Eigen::internal::plain_matrix_type_column_major<T>' being compiled
3>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug x64 ------
3>Project not selected to build for this solution configuration
========== Build: 1 succeeded, 1 failed, 2 up-to-date, 1 skipped ==========
I haven't seen such an error before... In the example project the same
code works. Copied in my application it causes such an error. Here the code:
void SurfaceReconstructScreen::TestCGAL()
{
//Types
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef CGAL::Point_with_normal_3<Kernel> Point_with_normal;
typedef Kernel::Sphere_3 Sphere;
typedef std::vector<Point_with_normal> PointList;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef CGAL::Poisson_reconstruction_function<Kernel>
Poisson_reconstruction_function;
typedef CGAL::Surface_mesh_default_triangulation_3 STr;
typedef CGAL::Surface_mesh_complex_2_in_triangulation_3<STr> C2t3;
typedef CGAL::Implicit_surface_3<Kernel,
Poisson_reconstruction_function> Surface_3;
// Poisson options
FT sm_angle = 20.0; // Min triangle angle in degrees.
FT sm_radius = 30; // Max triangle size w.r.t. point set average
spacing.
FT sm_distance = 0.375; // Surface Approximation error w.r.t. point
set average spacing.
// Reads the point set file in points[].
// Note: read_xyz_points_and_normals() requires an iterator over points
// + property maps to access each point's position and normal.
// The position property map can be omitted here as we use iterators
over Point_3 elements.
PointList points;
std::ifstream stream("data/kitten.xyz");
if (!stream ||
!CGAL::read_xyz_points_and_normals(
stream,
std::back_inserter(points),
CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type())))
{
std::cerr << "Error: cannot read file data/kitten.xyz" << std::endl;
return;
}
// Creates implicit function from the read points using the default
solver.
// Note: this method requires an iterator over points
// + property maps to access each point's position and normal.
// The position property map can be omitted here as we use iterators
over Point_3 elements.
Poisson_reconstruction_function function(points.begin(), points.end(),
CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type()) );
// Computes the Poisson indicator function f()
// at each vertex of the triangulation.
if ( ! function.compute_implicit_function() )
return;
// Computes average spacing
FT average_spacing = CGAL::compute_average_spacing(points.begin(),
points.end(),
6 /* knn = 1 ring
*/);
// Gets one point inside the implicit surface
// and computes implicit function bounding sphere radius.
Point inner_point = function.get_inner_point();
Sphere bsphere = function.bounding_sphere();
FT radius = std::sqrt(bsphere.squared_radius());
// Defines the implicit surface: requires defining a
// conservative bounding sphere centered at inner point.
FT sm_sphere_radius = 5.0 * radius;
FT sm_dichotomy_error = sm_distance*average_spacing/1000.0; //
Dichotomy error must be << sm_distance
Surface_3 surface(function,
Sphere(inner_point,sm_sphere_radius*sm_sphere_radius),
sm_dichotomy_error/sm_sphere_radius);
// Defines surface mesh generation criteria
CGAL::Surface_mesh_default_criteria_3<STr> criteria(sm_angle, //
Min triangle angle (degrees)
sm_radius*average_spacing, // Max triangle size
sm_distance*average_spacing); // Approximation error
// Generates surface mesh with manifold option
STr tr; // 3D Delaunay triangulation for surface mesh generation
C2t3 c2t3(tr); // 2D complex in 3D Delaunay triangulation
CGAL::make_surface_mesh(c2t3, //
reconstructed mesh
surface, //
implicit surface
criteria, //
meshing criteria
CGAL::Manifold_with_boundary_tag()); //
require manifold mesh
if(tr.number_of_vertices() == 0)
return;
// saves reconstructed surface mesh
std::ofstream out("kitten_poisson-20-30-0.375.off");
Polyhedron output_mesh;
CGAL::output_surface_facets_to_polyhedron(c2t3, output_mesh);
out << output_mesh;
return;
}
I am compiling in Visual Studio 2012 for x64.
Does anyone knows how to get rid of this error? Shall I file a bug?
Thanks a lot!!!
Best regards
Martin
--
Martin Klemm
Hochschule Offenburg
Badstraße 24
77652 Offenburg
Tel. +49 781 / 205 - 4681