2012-12-11 45 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或沙箱或中繼),則可能會有更多更改。但是「重寫」不應該是必須的。根據你的代碼,我看不到影響。 –

相關問題