I am using boost library version 1.54 with gcc --std=c++11.
I am trying a simple use of geometry::intersection as follows:
#include
#include
#include
#include
using namespace boost::geometry;
......
typedef model::d2::point_xy<double> point_xy;
model::polygon clipBounds;
// add points to clipBounds
model::polygon area;
// add points to area
model::polygon result;
if(boost::geometry::intersection(area, clipBounds, result))
{
std::cout << std::endl << "Boost intersection, size = " <<
num_points(result) << std::endl;
}
If I comment out the call to intersection, everything compiles. With it I
get:
In file included from /usr/include/boost/serialization/level.hpp:28:0,
from /usr/include/boost/serialization/nvp.hpp:31,
from ...:
/usr/include/boost/mpl/eval_if.hpp: In instantiation of ‘struct
boost::mpl::eval_if_c > >,
boost::range_mutable_iterator > > >’:
/usr/include/boost/range/iterator.hpp:63:63: required from ‘struct
boost::range_iterator > >’
/usr/include/boost/range/value_type.hpp:30:12: required from ‘struct
boost::range_value > >’
/usr/include/boost/geometry/algorithms/intersection.hpp:97:64: required
from ‘static bool boost::geometry::dispatch::intersection::apply(const Geometry1&, const Geometry2&,
GeometryOut&, const Strategy&) [with GeometryOut =
boost::geometry::model::polygon >; Strategy =
boost::geometry::strategy_intersection >,
boost::geometry::model::polygon >,
boost::geometry::model::d2::point_xy, void>; Geometry1 =
boost::geometry::model::polygon >; Geometry2 =
boost::geometry::model::polygon >; Tag1 = boost::geometry::polygon_tag; Tag2
= boost::geometry::polygon_tag; bool Reverse = false]’
/usr/include/boost/geometry/algorithms/intersection.hpp:201:67: required
from ‘bool boost::geometry::intersection(const Geometry1&, const Geometry2&,
GeometryOut&) [with Geometry1 =
boost::geometry::model::polygon >; Geometry2 =
boost::geometry::model::polygon >; GeometryOut =
boost::geometry::model::polygon >]’
/home/stanley/workspace/worldmodel/metric/map/GISCache.cpp:2492:62:
required from here
/usr/include/boost/mpl/eval_if.hpp:60:31: error: no type named ‘type’ in
‘boost::mpl::eval_if_c > >,
boost::range_mutable_iterator > > >::f_ {aka struct
boost::range_mutable_iterator > >}’
typedef typename f_::type type;
Since my code is virtually identical to the sample code in the
documentation, I am very puzzled by this. What have I missed? How do I get
this to compile?
(I do find it odd that this error refers to boost/serialization rather than
boost/geometry, but I suppose that has to do with the order of inclusion).
--
View this message in context: http://boost.2283326.n4.nabble.com/geometry-Cannot-compile-boost-geometry-in...
Sent from the Boost - Users mailing list archive at Nabble.com.