私はVS2015ブーストrtreeコードはコンパイルされません---なぜですか?
でコンパイルされません、次のコードをコンパイルするブースト1.61
を使用しています。それは---私はそれが事を怒らせているアダプタBOOST_GEOMETRY_REGISTER_POINT_2D_GET_SETの使用だと思う。
これがなぜ機能しないのか、それをどう修正することができますか?ここで
#include <boost/geometry/geometry.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/io/wkt/wkt.hpp>
#include <vector>
#include <boost/geometry/geometries/register/point.hpp>
class wxPoint
{
public:
wxPoint(double x, double y)
: m_x(x),
m_y(y)
{
}
wxPoint() {}
double getx() const
{
return m_x;
}
double gety() const
{
return m_y;
}
void setx(double in)
{
m_x = in;
}
void sety(double in)
{
m_y = in;
}
private:
double m_x;
double m_y;
};
BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET(
wxPoint,
double,
boost::geometry::cs::geographic<boost::geometry::degree>,
wxPoint::getx,
wxPoint::gety,
wxPoint::setx,
wxPoint::sety)
typedef std::pair<wxPoint, unsigned> value;
int main()
{
boost::geometry::index::rtree< value, boost::geometry::index::quadratic<16> > rtree;
wxPoint p(4, 1);
rtree.insert(std::make_pair(p, 1));
std::vector<value> result_s;
typedef boost::geometry::model::polygon<wxPoint> polygon_type;
polygon_type poly;
boost::geometry::read_wkt(
"POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3)"
"(4.0 2.0, 4.2 1.4, 4.8 1.9, 4.4 2.2, 4.0 2.0))", poly);
rtree.query(boost::geometry::index::within(poly), std::back_inserter(result_s));
return 0;
}
VCコンパイラからの要約情報は次のとおりです。
重大度コード説明プロジェクトファイルの行の抑制状態 エラーC2672「ブースト::幾何学::戦略::交差点:: relate_cartesian_segments >>、ブースト: :geometry :: policies :: relate :: segments_direction>、CalculationType> :: apply ':一致するオーバーロードされた関数が見つかりませんでしたscratch1 c:\ users \ simon \ downloads \ boost_1_61_0 \ boost_1_61_0 \ boost \ geometry \ algorithms \ detail \ overlay \ get_turn_info_helpers .hpp 230 エラーC2782 'boost :: tuples :: tuple>、boost :: geometry :: policies :: relate :: segments_direction :: return_type、boost :: tuples :: null_type、boost :: tuples :: null_type、boo st :: tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: null_type> boost: :geometry :: strategy :: intersection :: relate_cartesian_segments >>、boost :: geometry :: policies :: relate :: segments_direction>、CalculationType> ::適用(const Segment1 &、constセグメント2 &、const RobustPolicy &、const RobustPoint & 、const RobustPoint &、const RobustPoint &、const RobustPoint &) 'テンプレートパラメータRobustPoint'が曖昧です。 エラーC2784 'boost :: tuples :: tuple>、boost :: geometry :: policies :: relate :: segments_direction :: return_type、boost :: tuples :: null_type、boost: :boost :: tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: Boolean :: boost :: geometry :: strategy :: intersection :: relate_cartesian_segments >>、boost :: geometry :: policies :: relate :: segments_direction>、CalculationType> :: apply(const Segment1 &、constセグメント2 &、const RobustPolicy &、constのRobustPoint &、constのRobustPoint &、constのRobustPoint &、constのRobustPoint &) 'のテンプレート引数を推定できなかった 'constのブースト::幾何学::モデル::ポイント> 'scratch1とのC' から' constのRobustPoint &: \ users \ simon \ downloads \ boost_1_61_0 \ boost_1_61_0 \ boost \ geometry \ algorithms \ detail \ overlay \ get_turn_info_helpers.hpp 230 エラーC2780 'boost :: boost :: tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: tuple>、boost :: geometry :: policies :: relate :: segments_direction :: return_type、boost :: tuples :: null_type、ブースト::タプル:: null_type tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: null_type、boost :: tuples :: null_type> boost :: geometry :: strategy :: intersection :: relate_cartesian_segments >>:boost :: geometry :: policies :: relate :: segments_direction>、CalculationType> :: apply(const Segment1 &、constセグメント2 &、const RobustPolicy &) ': simon \ downloads \ boost_1_61_0 \ boost_1_61_0 \ boost \ geometry \ algorithms \ detail \ overlay \ get_turn_info_helpersにあります。HPP 230
そして、ここでより詳細なcompiler output
を後押しするためにブースト1.61
私はそれをしたでしょうが、出力が大きすぎてStackOverflowで許可されませんでした –
私は、あなたがいくつかの無関係な部分を切り取って、最も重要なビットを示し、残りの部分にリンクしている可能性があります:) –