chrisidefix / cgal-bindings

Automatically exported from code.google.com/p/cgal-bindings
Boost Software License 1.0
0 stars 0 forks source link

Compiler error on Mac OS X 10.8 with Homebrew CGAL/Swig (follows on Issue 23) #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This issue follows on Issue 23 (which did help the compilation go further; 
thank you!)

Problem now with "Alpha_shape_2.h:594:27: error: use of undeclared identifier 
'locate'"

# What steps will reproduce the problem?
1. Installed CGAL 4.0.2 and swig 2.0.8 with Homebrew on OS X
2. git clone https://code.google.com/p/cgal-bindings/ (HEAD at 2ea2630) and cd 
cgal-bindings
3. cmake -DCGAL_DIR=/usr/local/Cellar/cgal/4.0.2/lib/CGAL/ -DBUILD_PYTHON=ON 
-DCGAL_CXX_FLAGS=-DCGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES
4. make

# What is the expected output? What do you see instead?

When running make:

[ 58%] Building CXX object 
SWIG_CGAL/Alpha_shape_2/CMakeFiles/CGAL_Alpha_shape_2.dir/CGAL_Alpha_shape_2JAVA
_wrap.cxx.o
In file included from 
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Alpha_shape_2/CGAL_Alpha_shape_2JAVA_w
rap.cxx:283:
In file included from 
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Alpha_shape_2/all_includes.h:10:
In file included from 
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Alpha_shape_2/typedefs.h:11:
/usr/local/Cellar/cgal/4.0.2/include/CGAL/Alpha_shape_2.h:594:27: error: use of 
undeclared identifier 'locate'
      Face_handle pFace = locate(p, type, i);
                          ^
                          this->
/usr/local/Cellar/cgal/4.0.2/include/CGAL/Alpha_shape_2.h:584:14: note: in 
instantiation of member function 
'CGAL::Alpha_shape_2<CGAL::Delaunay_triangulation_2<CGAL::Epick, 
CGAL::Triangulation_data_structure_2<CGAL::Alpha_shape_vertex_base_2<CGAL::Epick
, CGAL::Default,
      CGAL::Boolean_tag<false>>, CGAL::Triangulation_face_base_with_info_2<JavaData, CGAL::Epick, CGAL::Alpha_shape_face_base_2<CGAL::Epick, CGAL::Triangulation_face_base_2<CGAL::Epick, CGAL::Triangulation_ds_face_base_2<void>>, CGAL::Boolean_tag<false>>>>>,
      CGAL::Boolean_tag<false> >::classify' requested here
      return classify( p, get_alpha());
             ^
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Alpha_shape_2/Alpha_shape_2.h:88:48: 
note: in instantiation of member function 
'CGAL::Alpha_shape_2<CGAL::Delaunay_triangulation_2<CGAL::Epick, 
CGAL::Triangulation_data_structure_2<CGAL::Alpha_shape_vertex_base_2<CGAL::Epick
,
      CGAL::Default, CGAL::Boolean_tag<false>>, CGAL::Triangulation_face_base_with_info_2<JavaData, CGAL::Epick, CGAL::Alpha_shape_face_base_2<CGAL::Epick, CGAL::Triangulation_face_base_2<CGAL::Epick, CGAL::Triangulation_ds_face_base_2<void>>,
      CGAL::Boolean_tag<false>>>>>, CGAL::Boolean_tag<false> >::classify' requested here
  SWIG_CGAL_FORWARD_CALL_1(Classification_type,classify,Point)
                                               ^
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Common/Macros.h:175:43: note: 
expanded from macro 'SWIG_CGAL_FORWARD_CALL_1'
  SWIG_CGAL_FORWARD_CALL_SCOPE_1(RET,NAME,NAME,IN_TYPE)
                                          ^
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Common/Macros.h:171:57: note: 
expanded from macro 'SWIG_CGAL_FORWARD_CALL_SCOPE_1'
    return RET(SWIG_CGAL_extract_data(this->get_data()).INAME(internal::Converter<IN_TYPE>::convert(c)));\
                                                        ^
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Alpha_shape_2/CGAL_Alpha_shape_2JAVA_w
rap.cxx:8190:45: note: in instantiation of member function 
'Alpha_shape_2_wrapper<CGAL::Alpha_shape_2<CGAL::Delaunay_triangulation_2<CGAL::
Epick,
      CGAL::Triangulation_data_structure_2<CGAL::Alpha_shape_vertex_base_2<CGAL::Epick, CGAL::Default, CGAL::Boolean_tag<false>>, CGAL::Triangulation_face_base_with_info_2<JavaData, CGAL::Epick, CGAL::Alpha_shape_face_base_2<CGAL::Epick,
      CGAL::Triangulation_face_base_2<CGAL::Epick, CGAL::Triangulation_ds_face_base_2<void>>, CGAL::Boolean_tag<false>>>>>, CGAL::Boolean_tag<false>>, Point_2, SWIG_Triangulation_2::CGAL_Vertex_handle<CGAL::Alpha_shape_2<CGAL::Delaunay_triangulation_2<CGAL::Epick,
      CGAL::Triangulation_data_structure_2<CGAL::Alpha_shape_vertex_base_2<CGAL::Epick, CGAL::Default, CGAL::Boolean_tag<false>>, CGAL::Triangulation_face_base_with_info_2<JavaData, CGAL::Epick, CGAL::Alpha_shape_face_base_2<CGAL::Epick,
      CGAL::Triangulation_face_base_2<CGAL::Epick, CGAL::Triangulation_ds_face_base_2<void>>, CGAL::Boolean_tag<false>>>>>, CGAL::Boolean_tag<false>>, Point_2>, SWIG_Triangulation_2::CGAL_Face_handle<CGAL::Alpha_shape_2<CGAL::Delaunay_triangulation_2<CGAL::Epick,
      CGAL::Triangulation_data_structure_2<CGAL::Alpha_shape_vertex_base_2<CGAL::Epick, CGAL::Default, CGAL::Boolean_tag<false>>, CGAL::Triangulation_face_base_with_info_2<JavaData, CGAL::Epick, CGAL::Alpha_shape_face_base_2<CGAL::Epick,
      CGAL::Triangulation_face_base_2<CGAL::Epick, CGAL::Triangulation_ds_face_base_2<void>>, CGAL::Boolean_tag<false>>>>>, CGAL::Boolean_tag<false>>, Point_2>, CGAL::Boolean_tag<false>,
      Delaunay_triangulation_2_wrapper<CGAL::Alpha_shape_2<CGAL::Delaunay_triangulation_2<CGAL::Epick, CGAL::Triangulation_data_structure_2<CGAL::Alpha_shape_vertex_base_2<CGAL::Epick, CGAL::Default, CGAL::Boolean_tag<false>>,
      CGAL::Triangulation_face_base_with_info_2<JavaData, CGAL::Epick, CGAL::Alpha_shape_face_base_2<CGAL::Epick, CGAL::Triangulation_face_base_2<CGAL::Epick, CGAL::Triangulation_ds_face_base_2<void>>, CGAL::Boolean_tag<false>>>>>, CGAL::Boolean_tag<false>>,
      SWIG_Triangulation_2::CGAL_Vertex_handle<CGAL::Alpha_shape_2<CGAL::Delaunay_triangulation_2<CGAL::Epick, CGAL::Triangulation_data_structure_2<CGAL::Alpha_shape_vertex_base_2<CGAL::Epick, CGAL::Default, CGAL::Boolean_tag<false>>,
      CGAL::Triangulation_face_base_with_info_2<JavaData, CGAL::Epick, CGAL::Alpha_shape_face_base_2<CGAL::Epick, CGAL::Triangulation_face_base_2<CGAL::Epick, CGAL::Triangulation_ds_face_base_2<void>>, CGAL::Boolean_tag<false>>>>>, CGAL::Boolean_tag<false>>, Point_2>,
      SWIG_Triangulation_2::CGAL_Face_handle<CGAL::Alpha_shape_2<CGAL::Delaunay_triangulation_2<CGAL::Epick, CGAL::Triangulation_data_structure_2<CGAL::Alpha_shape_vertex_base_2<CGAL::Epick, CGAL::Default, CGAL::Boolean_tag<false>>,
      CGAL::Triangulation_face_base_with_info_2<JavaData, CGAL::Epick, CGAL::Alpha_shape_face_base_2<CGAL::Epick, CGAL::Triangulation_face_base_2<CGAL::Epick, CGAL::Triangulation_ds_face_base_2<void>>, CGAL::Boolean_tag<false>>>>>, CGAL::Boolean_tag<false>>, Point_2>>
      >::classify' requested here
      result = (Classification_type)(arg1)->classify((Point_2 const &)*arg2);
                                            ^
/usr/local/Cellar/cgal/4.0.2/include/CGAL/Triangulation_2.h:410:3: note: must 
qualify identifier to find this declaration in dependent base class
  locate(const Point & p,
  ^
/usr/local/Cellar/cgal/4.0.2/include/CGAL/Triangulation_2.h:422:3: note: must 
qualify identifier to find this declaration in dependent base class
  locate(const Point & p, Face_handle start = Face_handle()) const
  ^
1 error generated.
make[2]: *** 
[SWIG_CGAL/Alpha_shape_2/CMakeFiles/CGAL_Alpha_shape_2.dir/CGAL_Alpha_shape_2JAV
A_wrap.cxx.o] Error 1
make[1]: *** [SWIG_CGAL/Alpha_shape_2/CMakeFiles/CGAL_Alpha_shape_2.dir/all] 
Error 2
make: *** [all] Error 2

# What version of the product are you using? On what operating system?

- Mac OS X 10.8.2
- cgal-bindings 2ea2630
- CGAL 4.0.2 via Homebrew package manager
- swig 2.0.8 via Homebrew

# Please provide any additional information below.

For reference, the output of cmake:

cmake -DCGAL_DIR=/usr/local/Cellar/cgal/4.0.2/lib/CGAL/ -DBUILD_PYTHON=ON 
-DCGAL_CXX_FLAGS=-DCGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES                         

~/code/cgal-bindings  
-- Build type: Release
-- USING CXXFLAGS = ' -DCGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES -O3 -DNDEBUG'
-- USING EXEFLAGS = '  '
-- Targetting Unix Makefiles
-- Using /usr/bin/c++ compiler.
-- DARWIN_VERSION=12
-- Mac Leopard detected
-- BUILD_Ruby is set to OFF: no CGAL-bindings for Ruby will be generated.
-- Found Python libs.
-- CGAL-SWIG Python files and libraries will be written in 
/Users/jsick/code/cgal-bindings/build-python/CGAL.
-- Found JNI: JNI include dirs 
/System/Library/Frameworks/JavaVM.framework/Headers 
/System/Library/Frameworks/JavaVM.framework/Headers.
-- CGAL-SWIG Java libraries and files will be respectively written in 
/Users/jsick/code/cgal-bindings/build-java/lib and 
/Users/jsick/code/cgal-bindings/build-java/CGAL.
-- NOTICE: CGAL imageIO has not be found, few bindings will not be compiled
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jsick/code/cgal-bindings

Original issue reported on code.google.com by jon.s...@gmail.com on 2 Oct 2012 at 9:43

GoogleCodeExporter commented 9 years ago
This is probably a bug in CGAL.
Can you try replacing locate by this->locate.
If it's a bug, I'll fix it in CGAL directly.

Original comment by sloriot...@gmail.com on 2 Oct 2012 at 9:50

GoogleCodeExporter commented 9 years ago
Is the replacement locate to this->locate be done in the installed 
Triangulation_2.h file? Or do I re-build cgal? Modifying just the installed 
Triangulation_2.h, the result is:

[ 56%] Building CXX object 
SWIG_CGAL/Triangulation_2/CMakeFiles/_CGAL_Triangulation_2.dir/CGAL_Triangulatio
n_2PYTHON_wrap.cxx.o
In file included from 
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Triangulation_2/CGAL_Triangulation_2PY
THON_wrap.cxx:3222:
In file included from 
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Triangulation_2/all_includes.h:11:
In file included from 
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Triangulation_2/typedefs.h:13:
/usr/local/Cellar/cgal/4.0.2/include/CGAL/Triangulation_2.h:410:3: error: 
expected member name or ';' after declaration specifiers
  this->locate(const Point & p,
  ^
/usr/local/Cellar/cgal/4.0.2/include/CGAL/Triangulation_2.h:422:3: error: 
expected member name or ';' after declaration specifiers
  this->locate(const Point & p, Face_handle start = Face_handle()) const
  ^
In file included from 
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Triangulation_2/CGAL_Triangulation_2PY
THON_wrap.cxx:3222:
In file included from 
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Triangulation_2/all_includes.h:11:
In file included from 
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Triangulation_2/typedefs.h:16:
/usr/local/Cellar/cgal/4.0.2/include/CGAL/Regular_triangulation_2.h:105:15: 
error: no member named 'locate' in 
'CGAL::Triangulation_2<CGAL::Weighted_point_mapper_2<CGAL::Regular_triangulation
_euclidean_traits_2<CGAL::Epick, double>>,
      CGAL::Triangulation_data_structure_2<CGAL::Regular_triangulation_vertex_base_2<CGAL::Regular_triangulation_euclidean_traits_2<CGAL::Epick, double>, CGAL::Triangulation_ds_vertex_base_2<void>>,
      CGAL::Regular_triangulation_face_base_2<CGAL::Regular_triangulation_euclidean_traits_2<CGAL::Epick, double>, CGAL::Triangulation_face_base_2<CGAL::Regular_triangulation_euclidean_traits_2<CGAL::Epick, double>,
      CGAL::Triangulation_ds_face_base_2<void>>>>>'
  using Base::locate;
        ~~~~~~^
/Users/jsick/code/cgal-bindings/SWIG_CGAL/Triangulation_2/CGAL_Triangulation_2PY
THON_wrap.cxx:4089:29: note: in instantiation of template class 
'CGAL::Regular_triangulation_2<CGAL::Regular_triangulation_euclidean_traits_2<CG
AL::Epick, double>,
      CGAL::Triangulation_data_structure_2<CGAL::Regular_triangulation_vertex_base_2<CGAL::Regular_triangulation_euclidean_traits_2<CGAL::Epick, double>, CGAL::Triangulation_ds_vertex_base_2<void>>,
      CGAL::Regular_triangulation_face_base_2<CGAL::Regular_triangulation_euclidean_traits_2<CGAL::Epick, double>, CGAL::Triangulation_face_base_2<CGAL::Regular_triangulation_euclidean_traits_2<CGAL::Epick, double>,
      CGAL::Triangulation_ds_face_base_2<void>>>>>' requested here
 typedef SWIG_CGAL_Iterator<CGAL_RT2::All_vertices_iterator,SWIG_Triangulation_2::CGAL_Vertex_handle<CGAL_RT2,Weighted_point_2> >  Regular_triangulation_2_All_vertices_iterator_SWIG_wrapper; 

and so on.

The fragment of Triangulation_2.h looks like:
  Face_handle
  this->locate(const Point & p,
         Locate_type & lt, int & li, 
         Face_handle start = Face_handle()) const
  {
    typedef Triangulation_structural_filtering_traits<Geom_traits> TSFT;
    typedef typename internal::Structural_filtering_selector_2< 
      TSFT::Use_structural_filtering_tag::value >::Tag Should_filter_tag;

    return generic_locate(p, lt, li, start, Should_filter_tag());
  }

  Face_handle
  this->locate(const Point & p, Face_handle start = Face_handle()) const
  {
    Locate_type lt;
    int li;
    return locate(p, lt, li, start);
  }

Original comment by jon.s...@gmail.com on 3 Oct 2012 at 12:03

GoogleCodeExporter commented 9 years ago
No, in the file Alpha_shape_2.h line 594.

replace:
Face_handle pFace = locate(p, type, i);
by
Face_handle pFace = this->locate(p, type, i);

Original comment by sloriot...@gmail.com on 3 Oct 2012 at 7:47

GoogleCodeExporter commented 9 years ago

Original comment by sloriot...@gmail.com on 3 Oct 2012 at 10:25

GoogleCodeExporter commented 9 years ago
I hit the same problem on Linux, and fixing Alpha_shape_2.h line 594 fixed it.

Original comment by dfGooden...@googlemail.com on 9 Feb 2013 at 4:23