Same code - different compilation results

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Same code - different compilation results

calvin_cw
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Same code - different compilation results

andreas.fabri

And  did you have a look at the CMakeLists.txt  ?

Maybe in yours you forgot to find Eigen ?

andreas

On 9/10/2020 9:35 AM, calvin_cw ([hidden email] via cgal-discuss Mailing List) wrote:
I encountered a weird phenomenon which I am unable to explain. I tried to
compile a simple code on hole filling. I have reduced the code to the
simplest form, to just using Polyhedron<Kernel>. 

If the code was run in the example
CGAL-5.1\examples\Polygon_mesh_processing\hole_filling_example, it executes
and ran fine. 

If i were to create a new Visual studio project, with the same exact
properties, it will give me an error.  
I've tried to ensures all properties are identical, but the same error
persist. 

Previously, i was using an inherited polyhedron class, with the same exact
error, but now I have reduced it to the generic polyhedron<Kernel> class.
The curious thing is that the code runs when its in the example folder of
CGAL 5.1 

 code 
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polygon_mesh_processing/triangulate_hole.h>
#include <CGAL/IO/OFF_reader.h>
#include <iostream>
#include <fstream>
#include <vector>

typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;


typedef CGAL::Polyhedron_3<Kernel>     Polyhedron;

typedef Polyhedron::Halfedge_handle    Halfedge_handle;
typedef Polyhedron::Facet_handle       Facet_handle;
typedef Polyhedron::Vertex_handle      Vertex_handle;


int main()
{
	const char* filename = "data/mech-holes-shark.off";
	std::ifstream input(filename);

	Polyhedron poly;
	if ( !input || !(input >> poly) || poly.empty() ) {
	std::cerr << "Not a valid off file." << std::endl;
	return 1;
	}

	// Incrementally fill the holes
	unsigned int nb_holes = 0;
	for (Halfedge_handle h : halfedges(poly))
	{
		if (h->is_border())
		{
			std::vector<Facet_handle>  patch_facets;
			std::vector<Vertex_handle> patch_vertices;
			bool success = std::get<0>(
				CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole(
					poly,
					h,
					std::back_inserter(patch_facets),
					std::back_inserter(patch_vertices),
				
CGAL::Polygon_mesh_processing::parameters::vertex_point_map(get(CGAL::vertex_point,
poly)).geom_traits(Kernel())));

			std::cout << " Number of facets in constructed patch: " <<
patch_facets.size() << std::endl;
			std::cout << " Number of vertices in constructed patch: " <<
patch_vertices.size() << std::endl;
			std::cout << " Fairing : " << (success ? "succeeded" : "failed") <<
std::endl;
			++nb_holes;
		}
	}

	std::cout << std::endl;
	std::cout << nb_holes << " holes have been filled" << std::endl;

	std::ofstream out("filled.off");
	out.precision(17);
	out << poly << std::endl;
	return 0;

}


error message 
Severity	Code	Description	Project	File	Line	Suppression State
Error	C2825
'CGAL::Polygon_mesh_processing::internal::Fair_Polyhedron_3<TriangleMesh,SparseLinearSolver,WeightCalculator,VertexPointMap>::Sparse_linear_solver':
must be a class or namespace when followed by '::'	CGAL_Testing
D:\installedLibraries\CGAL-5.1\include\CGAL\Polygon_mesh_processing\internal\fair_impl.h
46	






--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss

Reply | Threaded
Open this post in threaded view
|

Re: Same code - different compilation results

calvin_cw
Yes, i just discovered the issue is in the enabling of the Eigen macro.

thanks for helping!!



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss