2017-09-11 5 views
2

부스트 1.65.1의 새로운 버전으로 내 프로젝트를 컴파일하려고, 내가받을 다음과 같은 오류 :부스트 1.65.1 기하학적 거리 전략은 비주얼 스튜디오로 컴파일 에러 2017

C:\Users\twozn\Dev\soundtoolkit\stk\libraries\boost/geometry/strategies/distance.hpp(101): error C2664: 'int boost::mpl::assertion_failed<false>(boost::mpl::assert<false>::type)': cannot convert argument 1 from 'boost::mpl::failed ************(__cdecl boost::geometry::strategy::distance::services::default_strategy<boost::geometry::point_tag,boost::geometry::segment_tag,boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>,boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>,boost::geometry::cartesian_tag,boost::geometry::cartesian_tag,void>::NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE_COMBINATION::* ***********)(boost::mpl::assert_::types<Point1,Point2,CsTag1,CsTag2>)' to 'boost::mpl::assert<false>::type' 
1>  with 
1>  [ 
1>   Point1=boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>, 
1>   Point2=boost::geometry::model::point<float,2,boost::geometry::cs::cartesian>, 
1>   CsTag1=boost::geometry::cartesian_tag, 
1>   CsTag2=boost::geometry::cartesian_tag 
1>  ] 

라인

에 의해 트리거됩니다 상기 rtree

using Point = boost::geometry::model::point<float, 2,boost::geometry::cs::cartesian>; 
using Segment = boost::geometry::model::segment<Point>; 
using Value = std::pair<Segment, size_t>; 
boost::geometry::index::rtree<Value, boost::geometry::index::rstar<16>> rtree; 

로 정의

std::vector<Value> results; 
rtree.query(boost::geometry::index::nearest(Point(p.x, p.y), 1), std::back_inserter(results)); 

template 
< 
    typename GeometryTag1, 
    typename GeometryTag2, 
    typename Point1, 
    typename Point2 = Point1, 
    typename CsTag1 = typename cs_tag<Point1>::type, 
    typename CsTag2 = typename cs_tag<Point2>::type, 
    typename UnderlyingStrategy = void 
> 
struct default_strategy 
{ 
    BOOST_MPL_ASSERT_MSG 
     (
      false, NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE_COMBINATION 
      , (types<Point1, Point2, CsTag1, CsTag2>) 
     ); 
}; 

이 컴파일 및 부스트 1.64.0 제대로 일 : 주장은 (부스트/구조/전략/distance.hpp)입니다 트리거. 컴파일러는 Visual Studio 2017 Update 1입니다. 여기에 어떤 문제가 있습니까?

+0

당신이 정적 주장의 관련 비트를 게시 할 수 있습니까? 그것은 당신에게 뭔가를 말하려고 시도했지만, 당신은 그것을 잘라 냈습니다. (또한, 결과의 유형?) – sehe

+0

@sehe 나는 관련이있는 비트로 질문을 편집했다. –

답변

2

MSVC에 액세스 할 수 없기 때문에 더 많은 헤더를 포함해야합니다. Boost 1.64.0에 간접적으로 포함될 수 있습니다.

는 다음과 같은 자체에 포함 된 예제를 컴파일 할 수 있는지 확인 :

Live On Coliru

#include <boost/geometry/geometry.hpp> 
#include <boost/geometry/core/coordinate_system.hpp> 
#include <boost/geometry/geometries/segment.hpp> 
#include <boost/geometry/index/predicates.hpp> 

using Point = boost::geometry::model::point<float, 2,boost::geometry::cs::cartesian>; 
using Segment = boost::geometry::model::segment<Point>; 
using Value = std::pair<Segment, size_t>; 

int main() { 
    boost::geometry::index::rtree<Value, boost::geometry::index::rstar<16>> rtree; 

    std::vector<Value> results; 
    rtree.query(boost::geometry::index::nearest(Point(1, 2), 1), std::back_inserter(results)); 
} 
+0

'@ boost/geometry/index/predicates.hpp>를 포함한 @sehe가 고쳐주었습니다. –