2012-12-11 43 views
0

我正在使用boost几何库C++。该代码在旧版本的Eclipse(从pythonxy安装)中运行良好。现在我安装最新版本的eclipse和Mingw(x86_64-w64-mingw32)。错误出现在函数intersection_inserter()和boost :: geometry :: enrich_intersection_points()。Boost geometry intersection_inserter <polygon_2d>不起作用

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

误差如下:

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] 

回答

1

compare_distances当前未使用上提线,也没有在整个文件。你在使用Boost的(非常)旧版本吗?

可能是的,我建议升级。

+0

该代码是基于旧版本的boost,Boost几何库编写的。但是现在我下载了最新版本的Boost。你认为这是原因吗?如果是这样,那意味着我必须基于新版本的boost来重写我的程序?是的,我比较了增强库。在最新版本中,一些文件被删除。 – Jun

+0

自发布以来,界面并没有真正改变。但是,如果您使用了预发布(GGL或沙箱或中继),则可能会有更多更改。但是“重写”不应该是必须的。根据你的代码,我看不到影响。 –

相关问题