Subject: CGAL users discussion list
List archive
- From: Ramin H <>
- To:
- Subject: Re: [cgal-discuss] including optimize_mesh_3.h produces compile error
- Date: Thu, 3 Jun 2010 16:47:53 -0400
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=etHJwhZldYb3/XK0Br37VB5oRI76FGZyI/b+vQV5Fdq87Y2pfkDJFjcPdoibDMhrU4 OHnplSfFIbKPi9jTbyR0MUkr14YyBuBYMDNKMcVoRmFc/swIEns6dPz+NPPOWxbNhdG0 DfCmRGIEFXw0xdOePBmifulu/Y+lYoh8yBJqQ=
Hi Stephane,
Thanks for the patches. I applied both patches (patch -p0 < filename.diff) in CGAL-3.6/include/CGAL but I am still getting the same error. (I checked the files and the changes are applied).
It's strange that these patches fixed the problem for you but I still have the same error. Should I compile CGAL again after applying these patches?
I am going to copy/paste the full error list from compiling the little cpp I sent you.
Thanks,
-Ramin
=== Begin Errors ===========================
1>------ Build started: Project: EMF, Configuration: Release Win32 ------
1> main.cpp
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(764): error C2039: 'iterator_category' : is not a member of 'CGAL::Point_3<R_>'
1> with
1> [
1> R_=K
1> ]
1> main.cpp(17) : see reference to class template instantiation 'std::iterator_traits<_Iter>' being compiled
1> with
1> [
1> _Iter=Point_3
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(764): error C2146: syntax error : missing ';' before identifier 'iterator_category'
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(764): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(764): error C2602: 'std::iterator_traits<_Iter>::iterator_category' is not a member of a base class of 'std::iterator_traits<_Iter>'
1> with
1> [
1> _Iter=Point_3
1> ]
1> d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(764) : see declaration of 'std::iterator_traits<_Iter>::iterator_category'
1> with
1> [
1> _Iter=Point_3
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(764): error C2868: 'std::iterator_traits<_Iter>::iterator_category' : illegal syntax for using-declaration; expected qualified-name
1> with
1> [
1> _Iter=Point_3
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(765): error C2039: 'value_type' : is not a member of 'CGAL::Point_3<R_>'
1> with
1> [
1> R_=K
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(765): error C2146: syntax error : missing ';' before identifier 'value_type'
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(765): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(765): error C2602: 'std::iterator_traits<_Iter>::value_type' is not a member of a base class of 'std::iterator_traits<_Iter>'
1> with
1> [
1> _Iter=Point_3
1> ]
1> d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(765) : see declaration of 'std::iterator_traits<_Iter>::value_type'
1> with
1> [
1> _Iter=Point_3
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(765): error C2868: 'std::iterator_traits<_Iter>::value_type' : illegal syntax for using-declaration; expected qualified-name
1> with
1> [
1> _Iter=Point_3
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(766): error C2039: 'difference_type' : is not a member of 'CGAL::Point_3<R_>'
1> with
1> [
1> R_=K
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(766): error C2146: syntax error : missing ';' before identifier 'difference_type'
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(766): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(766): error C2602: 'std::iterator_traits<_Iter>::difference_type' is not a member of a base class of 'std::iterator_traits<_Iter>'
1> with
1> [
1> _Iter=Point_3
1> ]
1> d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(766) : see declaration of 'std::iterator_traits<_Iter>::difference_type'
1> with
1> [
1> _Iter=Point_3
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(766): error C2868: 'std::iterator_traits<_Iter>::difference_type' : illegal syntax for using-declaration; expected qualified-name
1> with
1> [
1> _Iter=Point_3
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(768): error C2039: 'pointer' : is not a member of 'CGAL::Point_3<R_>'
1> with
1> [
1> R_=K
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(768): error C2146: syntax error : missing ';' before identifier 'pointer'
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(768): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(768): error C2602: 'std::iterator_traits<_Iter>::pointer' is not a member of a base class of 'std::iterator_traits<_Iter>'
1> with
1> [
1> _Iter=Point_3
1> ]
1> d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(768) : see declaration of 'std::iterator_traits<_Iter>::pointer'
1> with
1> [
1> _Iter=Point_3
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(768): error C2868: 'std::iterator_traits<_Iter>::pointer' : illegal syntax for using-declaration; expected qualified-name
1> with
1> [
1> _Iter=Point_3
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(769): error C2039: 'reference' : is not a member of 'CGAL::Point_3<R_>'
1> with
1> [
1> R_=K
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(769): error C2146: syntax error : missing ';' before identifier 'reference'
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(769): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(769): error C2602: 'std::iterator_traits<_Iter>::reference' is not a member of a base class of 'std::iterator_traits<_Iter>'
1> with
1> [
1> _Iter=Point_3
1> ]
1> d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(769) : see declaration of 'std::iterator_traits<_Iter>::reference'
1> with
1> [
1> _Iter=Point_3
1> ]
1>d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(769): error C2868: 'std::iterator_traits<_Iter>::reference' : illegal syntax for using-declaration; expected qualified-name
1> with
1> [
1> _Iter=Point_3
1> ]
1>c:\Program Files\CGAL-3.6\include\CGAL/Dimension.h(57): error C2903: 'Ambient_dimension' : symbol is neither a class template nor a function template
1> main.cpp(17) : see reference to class template instantiation 'CGAL::Ambient_dimension<T,K>' being compiled
1> with
1> [
1> T=int,
1> K=Point_3
1> ]
1>c:\Program Files\CGAL-3.6\include\CGAL/Dimension.h(57): error C2947: expecting '>' to terminate template-argument-list, found '<'
1>c:\Program Files\CGAL-3.6\include\CGAL/Dimension.h(57): error C2146: syntax error : missing ',' before identifier 'T'
1>c:\Program Files\CGAL-3.6\include\CGAL/Dimension.h(57): error C2516: 'T' : is not a legal base class
1> main.cpp(17) : see declaration of 'T'
1>c:\Program Files\CGAL-3.6\include\CGAL/Dimension.h(57): error C2143: syntax error : missing ',' before '>'
1>c:\Program Files\CGAL-3.6\include\CGAL/Dimension.h(57): error C2039: 'type' : is not a member of '`global namespace''
1>c:\Program Files\CGAL-3.6\include\CGAL/Dimension.h(59): error C2903: 'Ambient_dimension' : symbol is neither a class template nor a function template
1>c:\Program Files\CGAL-3.6\include\CGAL/Dimension.h(59): error C2059: syntax error : '<'
1>c:\Program Files\CGAL-3.6\include\CGAL/Dimension.h(59): error C2039: 'type' : is not a member of '`global namespace''
1>c:\Program Files\CGAL-3.6\include\CGAL/Dimension.h(59): error C2238: unexpected token(s) preceding ';'
=== End Errors ===========================
On Thu, Jun 3, 2010 at 11:40 AM, Stephane Tayeb <> wrote:
Ramin H wrote:Hi again,
Thanks Stephane, what I found was a minor issue, not the actual bug. The
real bug is still there and I was hoping you could help me resolve it.
Are you able to successfully compile the code I sent you? I am copy/pasting
the code here again:
=======================
#include <CGAL/Mesh_3/global_parameters.h>
#include <CGAL/optimize_mesh_3.h>
int main( int argc, char *argv[] )
{
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Point_3<K> Point_3;
const Point_3 p, q, r, s;
const Point_3& volume_center = CGAL::centroid(p, q, r, s);
return 0;
}
=======================
I am still getting:
error C2039: 'iterator_category' : is not a member of 'CGAL::Point_3<R_>'
d:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility 764
Thanks,
-Ramin
The following patches should work better ! They have to be applied in include/CGAL.
Regards,
Stephane.
--Stephane Tayeb
Software engineer - INRIA Sophia Antipolis
Geometrica Project-Team
--You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
Index: Mesh_3/C3T3_helpers.h
===================================================================
--- Mesh_3/C3T3_helpers.h
+++ Mesh_3/C3T3_helpers.h
@@ -26,6 +26,7 @@
#include <CGAL/linear_least_squares_fitting_3.h>
#include <CGAL/Mesh_3/Triangulation_helpers.h>
+#include <CGAL/tuple.h>
#include <boost/optional.hpp>
#include <boost/iterator/transform_iterator.hpp>
@@ -33,6 +34,8 @@
#include <boost/lambda/bind.hpp>
#include <functional>
+#include <vector>
+#include <set>
namespace CGAL {
namespace Mesh_3 {
Index: Mesh_3/dihedral_angle_3.h
===================================================================
--- Mesh_3/dihedral_angle_3.h
+++ Mesh_3/dihedral_angle_3.h
@@ -20,6 +20,7 @@
#ifndef CGAL_MESH_3_DIHEDRAL_ANGLE_3_H
#define CGAL_MESH_3_DIHEDRAL_ANGLE_3_H
+#include <CGAL/number_type_basic.h>
#include <CGAL/Kernel_traits.h>
#include <cmath>
Index: Mesh_3/Triangulation_sizing_field.h
===================================================================
--- Mesh_3/Triangulation_sizing_field.h
+++ Mesh_3/Triangulation_sizing_field.h
@@ -26,6 +26,8 @@
#define CGAL_MESH_3_TRIANGULATION_SIZING_FIELD_H
#include <CGAL/Triangulation_cell_base_3.h>
+#include <CGAL/Triangulation_data_structure_3.h>
+#include <CGAL/Regular_triangulation_3.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <boost/iterator/transform_iterator.hpp>
Index: Mesh_3/global_parameters.h
===================================================================
--- Mesh_3/global_parameters.h
+++ Mesh_3/global_parameters.h
@@ -24,6 +24,8 @@
#ifndef CGAL_MESH_3_GLOBAL_PARAMETERS_H
#define CGAL_MESH_3_GLOBAL_PARAMETERS_H
+#include <CGAL/config.h>
+
#define BOOST_PARAMETER_MAX_ARITY 8
#include <boost/parameter.hpp>
Index: centroid.h
===================================================================
--- centroid.h
+++ centroid.h
@@ -808,20 +808,36 @@
// computes the centroid of a set of kernel objects
// takes an iterator range over kernel objects
+
+// We use two different functions here in order to avoid a wrong match with
+// CGAL::centroid(Point_3, Point_3, Point_3, Point_3)
template < typename InputIterator,
- typename K,
- typename Dim_tag >
+ typename K >
inline
typename Access::Point<K, typename Ambient_dimension<typename std::iterator_traits<InputIterator>::value_type, K>::type>::type
centroid(InputIterator begin,
InputIterator end,
const K& k,
- Dim_tag tag)
+ Dynamic_dimension_tag tag)
{
typedef typename std::iterator_traits<InputIterator>::value_type Value_type;
return internal::centroid(begin, end, k,(Value_type*) NULL, tag);
}
+template < typename InputIterator,
+ typename K,
+ int d>
+inline
+typename Access::Point<K, typename Ambient_dimension<typename std::iterator_traits<InputIterator>::value_type, K>::type>::type
+centroid(InputIterator begin,
+ InputIterator end,
+ const K& k,
+ Dimension_tag<d> tag)
+{
+ typedef typename std::iterator_traits<InputIterator>::value_type Value_type;
+ return internal::centroid(begin, end, k,(Value_type*) NULL, tag);
+}
+
namespace internal {
// computes the centroid of a set of kernel objects
- [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/02/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/02/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/07/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/07/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Ramin H, 06/03/2010
- Re: [cgal-discuss] including optimize_mesh_3.h produces compile error, Stephane Tayeb, 06/02/2010
Archive powered by MHonArc 2.6.16.