Subject: CGAL users discussion list
List archive
- From: Fisher <>
- To:
- Subject: [cgal-discuss] Use Point_set_2.h with LLVM clang
- Date: Wed, 25 Jul 2012 11:57:46 -0700 (PDT)
Hi,
I am using some functions in Point_set_2.h for range searching. The
compilation is fine with g++ 4.7 and 4.6 with c++0x turned on. But when I
tried to compile my code using clang, I got this error:
/usr/local/include/CGAL/Point_set_2.h:359:15: error: no viable conversion
from
'Vertex_iterator' (aka 'CGAL::Triangulation_2<CGAL::Epick,
CGAL::Triangulation_data_structure_2<CGAL::Triangulation_vertex_base_2<CGAL::
Epick, CGAL::Triangulation_ds_vertex_base_2<void> >,
CGAL::Triangulation_ds_face_base_2<void> > >::Finite_vertices_iterator') to
'typename
list<CC_iterator<Compact_container<Triangulation_vertex_base_2<Epick,
Triangulation_ds_vertex_base_2<Triangulation_data_structure_2<
Triangulation_vertex_base_2<Epick,
Triangulation_ds_vertex_base_2<void> >,
Triangulation_ds_face_base_2<void> > > >, Default>, false>,
allocator<CC_iterator<Compact_container<Triangulation_vertex_base_2<Epick,
Triangulation_ds_vertex_base_2<Triangulation_data_structure_2<
Triangulation_vertex_base_2<Epick,
Triangulation_ds_vertex_base_2<void> >,
Triangulation_ds_face_base_2<void> > > >, Default>, false> > >::value_type'
(aka
'CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::
Triangulation_vertex_base_2<CGAL::Epick,
CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<CGAL::
Triangulation_vertex_base_2<CGAL::Epick,
CGAL::Triangulation_ds_vertex_base_2<void> >,
CGAL::Triangulation_ds_face_base_2<void> > > >, CGAL::Default>, false>')
*res=
vit; res++; ^~~ /usr/local/include/CGAL/Point_set_2.h:429:6: note: in
instantiation of function template specialization
'CGAL::Point_set_2<CGAL::Epick,
CGAL::Triangulation_data_structure_2<CGAL::Triangulation_vertex_base_2<CGAL::
Epick, CGAL::Triangulation_ds_vertex_base_2<void> >,
CGAL::Triangulation_ds_face_base_2<void> >
>::range_search<std::__1::back_insert_iterator<std::__1::list<CGAL::internal::
CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<CGAL::
Epick,
CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<CGAL::
Triangulation_vertex_base_2<CGAL::Epick,
CGAL::Triangulation_ds_vertex_base_2<void> >,
CGAL::Triangulation_ds_face_base_2<void> > > >, CGAL::Default>, false>,
std::__1::allocator<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::
Triangulation_vertex_base_2<CGAL::Epick,
CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<CGAL::
Triangulation_vertex_base_2<CGAL::Epick,
CGAL::Triangulation_ds_vertex_base_2<void> >,
CGAL::Triangulation_ds_face_base_2<void> > > >, CGAL::Default>, false> > > >
>'
requested here range_search(C,std::back_inserter(L)); ^
/Users/fy/Dropbox/projects/gsv/lab/furry/common/point_set.cc:49:14: note: in
instantiation of function template specialization
'CGAL::Point_set_2<CGAL::Epick,
CGAL::Triangulation_data_structure_2<CGAL::Triangulation_vertex_base_2<CGAL::
Epick, CGAL::Triangulation_ds_vertex_base_2<void> >,
CGAL::Triangulation_ds_face_base_2<void> >
>::range_search<std::__1::back_insert_iterator<std::__1::vector<CGAL::internal::
CC_iterator<CGAL::Compact_container<CGAL::Triangulation_vertex_base_2<CGAL::
Epick,
CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<CGAL::
Triangulation_vertex_base_2<CGAL::Epick,
CGAL::Triangulation_ds_vertex_base_2<void> >,
CGAL::Triangulation_ds_face_base_2<void> > > >, CGAL::Default>, false>,
std::__1::allocator<CGAL::internal::CC_iterator<CGAL::Compact_container<CGAL::
Triangulation_vertex_base_2<CGAL::Epick,
CGAL::Triangulation_ds_vertex_base_2<CGAL::Triangulation_data_structure_2<CGAL::
Triangulation_vertex_base_2<CGAL::Epick,
CGAL::Triangulation_ds_vertex_base_2<void> >,
CGAL::Triangulation_ds_face_base_2<void> > > >, CGAL::Default>, false> > > >
>'
requested here point_set_.range_search(a, b, c, d,
std::back_inserter(handles));
^ /usr/local/include/CGAL/Compact_container.h:756:5: note: candidate
constructor
not viable: no known conversion from 'Vertex_iterator' (aka
'CGAL::Triangulation_2<CGAL::Epick,
CGAL::Triangulation_data_structure_2<CGAL::Triangulation_vertex_base_2<CGAL::
Epick, CGAL::Triangulation_ds_vertex_base_2<void> >,
CGAL::Triangulation_ds_face_base_2<void> > >::Finite_vertices_iterator') to
'Nullptr_t' (aka 'const void *') for 1st argument; take the address of the
argument with & CC_iterator (Nullptr_t CGAL_assertion_code(n)) ^
/usr/local/include/CGAL/Compact_container.h:743:5: note: candidate
constructor
not viable: no known conversion from 'Vertex_iterator' (aka
'CGAL::Triangulation_2<CGAL::Epick,
CGAL::Triangulation_data_structure_2<CGAL::Triangulation_vertex_base_2<CGAL::
Epick, CGAL::Triangulation_ds_vertex_base_2<void> >,
CGAL::Triangulation_ds_face_base_2<void> > >::Finite_vertices_iterator') to
'const iterator &' (aka 'const CC_iterator<Self, false> &') for 1st
argument;
CC_iterator (const iterator &it) ^
/usr/local/include/CGAL/Triangulation_2.h:164:5: note: candidate function
operator const Vertex_handle() const { return Base::base(); } ^
/usr/bin/../lib/c++/v1/iterator:631:97: note: passing argument to parameter
'__value_' here _LIBCPP_INLINE_VISIBILITY back_insert_iterator&
operator=(typename _Container::value_type&& __value_) ^ 1 error generated.
The code snippet causing this problem is
ypedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Point_set_2<K>::Vertex_handle VertexHandle;
typedef K::Point_2 Point_2;
std::vector<VertexHandle> handles;
Point_2 a(rect.x, rect.y + rect.height);
Point_2 b(rect.x, rect.y);
Point_2 c(rect.x + rect.width, rect.y);
Point_2 d(rect.x + rect.width, rect.y + rect.height);
point_set_.range_search(a, b, c, d, std::back_inserter(handles));
std::vector<cv::Point2d> points;
points.reserve(handles.size());
for (auto it = handles.begin(); it != handles.end(); ++it)
{
auto p = (*it)->point();
points.push_back(cv::Point2d(p.x(), p.y()));
}
My platform is Mac OS X 10.7 and the compiler I was using is the one shipped
with XCode Apple clang 3.1 (LLVM 3.1 svn). My CGAL is compiled with c++11
support.
I am not quite familiar with the internal of CGAL and thus it is hard for me
to interpret the error messages. Can anyone tell me what's going wrong here
and how to fix it?
Thanks,
Fisher Yu
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Use-Point-set-2-h-with-LLVM-clang-tp4655577.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Use Point_set_2.h with LLVM clang, Fisher, 07/25/2012
- Re: [cgal-discuss] Use Point_set_2.h with LLVM clang, Philipp Moeller, 07/26/2012
- [cgal-discuss] Re: Use Point_set_2.h with LLVM clang, Fisher, 07/26/2012
- Re: [cgal-discuss] Use Point_set_2.h with LLVM clang, Philipp Moeller, 07/26/2012
Archive powered by MHonArc 2.6.18.