0

I am using boost geometry library C++. The code works well in the old version of Eclipse (which is installed from pythonxy). Now I install latest version of eclipse and Mingw (x86_64-w64-mingw32). the errors appear at the function intersection_inserter() and boost::geometry::enrich_intersection_points().

        typedef std::vector<polygon_2d > polygon_list;
    polygon_list v;
    intersection_inserter<polygon_2d>(square, *polygon_iterator,
                                            std::back_inserter(v));

the error is as following:

c:\program files\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/
../../../../include/boost/geometry/algorithms/intersection.hpp:293:27:
required from 'OutputIterator boost::geometry::intersection_inserter(
const Geometry1&, const Geometry2&, OutputIterator) [with GeometryOut = 
boost::geometry::polygon<boost::geometry::point_xy<double,  
boost::geometry::cs::cartesian> >; Geometry1 = 
boost::geometry::box<boost::geometry::point_xy<double, 
boost::geometry::cs::cartesian> >; Geometry2 = 
boost::geometry::polygon<boost::geometry::point_xy<double,
boost::geometry::cs::cartesian> >; OutputIterator = 
std::back_insert_iterator<std::vector<boost::geometry::polygon<boost::
geometry::point_xy<double, boost::geometry::cs::cartesian> > > >]'
..\src\VoronoiPolygons.cpp:397:85:   required from here
c:\program files\mingw64\bin\../lib/gcc/x86_64-w64-
mingw32/4.7.1/../../../../include/boost/geometry/algorithms/overlay/
enrich_intersection_points.hpp:198:20: error: 'compare_distances' was not
declared in this scope, and no declarations were found by 
argument-dependent lookup at the point of instantiation [-fpermissive]
ildjarn
  • 62,044
  • 9
  • 127
  • 211
Jun
  • 419
  • 1
  • 5
  • 14

1 Answers1

1

compare_distances is currently not used on the mentioned line, nor in the whole file. Are you using a (very) old version of Boost?

Probably yes, I advice to upgrade.

Barend Gehrels
  • 1,047
  • 6
  • 8
  • The code is written based on the old version of boost, Boost geometry library. But now I download the latest version of Boost. Do you think this is the reason? If so, that means I have to rewrite my program based on the new version of boost? Yes, I compared the boost library. In the latest version, some files are deleted. – Jun Dec 12 '12 at 08:10
  • The interface is not really changed since Release. However, if you used a prerelease (GGL or from sandbox or trunk), there might be more changes. But a "rewrite" should not be necessary. Based on your code I cannot see the impact. – Barend Gehrels Dec 13 '12 at 22:17