Boost rtree Beispiel-Code kann nicht kompiliert werden



  • Ich verwende Boost 1.55 und habe dazu folgendes Beispiel aus der Doku:

    http://www.boost.org/doc/libs/1_55_0/libs/geometry/doc/html/geometry/spatial_indexes/rtree_quickstart.html

    Okay, bei mir ist beim instanziieren des rtrees Schluss, hier ist mein Code:

    #include <boost/geometry.hpp>
    #include <boost/geometry/geometries/point.hpp>
    #include <boost/geometry/geometries/box.hpp>
    
    #include <boost/geometry/index/rtree.hpp>
    
    // to store queries results
    #include <vector>
    
    // just for output
    #include <iostream>
    #include <boost/foreach.hpp>
    
    namespace bg = boost::geometry;
    namespace bgi = boost::geometry::index;
    
    typedef bg::model::point<float, 2, bg::cs::cartesian> point;
    typedef bg::model::box<point> box;
    typedef std::pair<box, unsigned> value;
    
    int main() {
    	// create the rtree using default constructor
    	bgi::rtree< value, bgi::quadratic<16> > rtree;  // <- verursacht Fehler
    
    	return 0;
    }
    

    Hier die Meldungen:

    1>------ Erstellen gestartet: Projekt: ConsoleApplication1, Konfiguration: Debug Win32 ------
    1>  main.cpp
    1>c:\mein\Pfad\boost_1_55_0\boost\intrusive\detail\has_member_function_callable_with.hpp(200): error C2228: Links von ".select_on_container_copy_construction" muss sich eine Klasse/Struktur/Union befinden.
    1>          Typ ist 'boost::move_detail::add_rvalue_reference<U>::type'
    1>          c:\mein\Pfad\boost_1_55_0\boost\intrusive\detail\has_member_function_callable_with.hpp(276): Siehe Verweis auf die Instanziierung der gerade kompilierten Klassen-template "boost::container::container_detail::has_member_function_callable_with_select_on_container_copy_construction_impl<Fun,true,>".
    1>          with
    1>          [
    1>              Fun=std::allocator<boost::geometry::index::detail::rtree::dynamic_internal_node<std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>
    1>          ]
    1>          c:\mein\Pfad\boost_1_55_0\boost\container\allocator_traits.hpp(262): Siehe Verweis auf die Instanziierung der gerade kompilierten Klassen-template "boost::container::container_detail::has_member_function_callable_with_select_on_container_copy_construction<const Alloc,>".
    1>          with
    1>          [
    1>              Alloc=std::allocator<boost::geometry::index::detail::rtree::dynamic_internal_node<std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>
    1>          ]
    1>          c:\mein\Pfad\boost_1_55_0\boost\geometry\index\detail\rtree\node\node_d_mem_dynamic.hpp(282): Siehe Verweis auf die Instanziierung der gerade kompilierten Klassen-template "boost::container::allocator_traits<AllocNode>".
    1>          with
    1>          [
    1>              AllocNode=std::allocator<boost::geometry::index::detail::rtree::dynamic_internal_node<std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>
    1>          ]
    1>          c:\mein\Pfad\boost_1_55_0\boost\geometry\index\detail\rtree\node\node_d_mem_dynamic.hpp(336): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "void boost::geometry::index::detail::rtree::destroy_dynamic_node<boost::geometry::index::detail::rtree::dynamic_internal_node<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>::apply<std::allocator<_Other>,boost::geometry::index::detail::rtree::dynamic_node<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag>*>(AllocNode &,BaseNodePtr)".
    1>          with
    1>          [
    1>              Value=std::pair<box,unsigned int>
    1>  ,            Parameters=boost::geometry::index::quadratic<16,4>
    1>  ,            Box=boost::geometry::model::box<point>
    1>  ,            Allocators=boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
    1>  ,            _Other=boost::geometry::index::detail::rtree::dynamic_internal_node<std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
    1>  ,            AllocNode=std::allocator<boost::geometry::index::detail::rtree::dynamic_internal_node<std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>
    1>  ,            BaseNodePtr=boost::geometry::index::detail::rtree::dynamic_node<std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag> *
    1>          ]
    1>          c:\mein\Pfad\boost_1_55_0\boost\geometry\index\detail\rtree\node\node_d_mem_dynamic.hpp(336): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "void boost::geometry::index::detail::rtree::destroy_dynamic_node<boost::geometry::index::detail::rtree::dynamic_internal_node<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>::apply<std::allocator<_Other>,boost::geometry::index::detail::rtree::dynamic_node<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag>*>(AllocNode &,BaseNodePtr)".
    1>          with
    1>          [
    1>              Value=std::pair<box,unsigned int>
    1>  ,            Parameters=boost::geometry::index::quadratic<16,4>
    1>  ,            Box=boost::geometry::model::box<point>
    1>  ,            Allocators=boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
    1>  ,            _Other=boost::geometry::index::detail::rtree::dynamic_internal_node<std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
    1>  ,            AllocNode=std::allocator<boost::geometry::index::detail::rtree::dynamic_internal_node<std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>
    1>  ,            BaseNodePtr=boost::geometry::index::detail::rtree::dynamic_node<std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::rtree::node_d_mem_static_tag> *
    1>          ]
    1>          c:\mein\Pfad\boost_1_55_0\boost\geometry\index\detail\rtree\node\node_d_mem_dynamic.hpp(333): Bei der Kompilierung der  Klassen-template der void boost::geometry::index::detail::rtree::destroy_node<Allocators,boost::geometry::index::detail::rtree::dynamic_internal_node<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>::apply(Allocators &,boost::geometry::index::detail::rtree::dynamic_node<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag> *)-Memberfunktion
    1>          with
    1>          [
    1>              Allocators=boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
    1>  ,            Value=std::pair<box,unsigned int>
    1>  ,            Parameters=boost::geometry::index::quadratic<16,4>
    1>  ,            Box=boost::geometry::model::box<point>
    1>          ]
    1>          c:\mein\Pfad\boost_1_55_0\boost\geometry\index\detail\rtree\visitors\destroy.hpp(51): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "void boost::geometry::index::detail::rtree::destroy_node<Allocators,boost::geometry::index::detail::rtree::dynamic_internal_node<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>::apply(Allocators &,boost::geometry::index::detail::rtree::dynamic_node<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag> *)".
    1>          with
    1>          [
    1>              Allocators=boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
    1>  ,            Value=std::pair<box,unsigned int>
    1>  ,            Parameters=boost::geometry::index::quadratic<16,4>
    1>  ,            Box=boost::geometry::model::box<point>
    1>          ]
    1>          c:\mein\Pfad\boost_1_55_0\boost\geometry\index\detail\rtree\visitors\destroy.hpp(51): Siehe Verweis auf die Instanziierung der gerade kompilierten Klassen-template "boost::geometry::index::detail::rtree::destroy_node<Allocators,boost::geometry::index::detail::rtree::dynamic_internal_node<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>".
    1>          with
    1>          [
    1>              Allocators=boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
    1>  ,            Value=std::pair<box,unsigned int>
    1>  ,            Parameters=boost::geometry::index::quadratic<16,4>
    1>  ,            Box=boost::geometry::model::box<point>
    1>          ]
    1>          c:\mein\Pfad\boost_1_55_0\boost\geometry\index\detail\rtree\visitors\destroy.hpp(35): Bei der Kompilierung der  Klassen-template der void boost::geometry::index::detail::rtree::visitors::destroy<std::pair<box,unsigned int>,boost::geometry::index::detail::rtree::options<boost::geometry::index::quadratic<16,4>,boost::geometry::index::detail::rtree::insert_default_tag,boost::geometry::index::detail::rtree::choose_by_content_diff_tag,boost::geometry::index::detail::rtree::split_default_tag,boost::geometry::index::detail::rtree::quadratic_tag,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::translator<IndexableGetter,EqualTo>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::allocators<std::allocator<Value>,Value,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>::operator ()(boost::geometry::index::detail::rtree::dynamic_internal_node<Value,Parameters,Box,Allocators,boost::geometry::index::detail::rtree::node_d_mem_static_tag> &)-Memberfunktion
    1>          with
    1>          [
    1>              IndexableGetter=boost::geometry::index::indexable<value>
    1>  ,            EqualTo=boost::geometry::index::equal_to<value>
    1>  ,            Value=value
    1>  ,            Parameters=boost::geometry::index::quadratic<16,4>
    1>  ,            Box=boost::geometry::model::box<point>
    1>  ,            Allocators=boost::geometry::index::detail::rtree::allocators<std::allocator<value>,std::pair<box,unsigned int>,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>
    1>          ]
    1>          c:\mein\Pfad\boost_1_55_0\boost\geometry\index\rtree.hpp(1285): Siehe Verweis auf die Instanziierung der gerade kompilierten Klassen-template "boost::geometry::index::detail::rtree::visitors::destroy<std::pair<box,unsigned int>,boost::geometry::index::detail::rtree::options<boost::geometry::index::quadratic<16,4>,boost::geometry::index::detail::rtree::insert_default_tag,boost::geometry::index::detail::rtree::choose_by_content_diff_tag,boost::geometry::index::detail::rtree::split_default_tag,boost::geometry::index::detail::rtree::quadratic_tag,boost::geometry::index::detail::rtree::node_d_mem_static_tag>,boost::geometry::index::detail::translator<IndexableGetter,EqualTo>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::allocators<std::allocator<Value>,Value,boost::geometry::index::quadratic<16,4>,boost::geometry::model::box<point>,boost::geometry::index::detail::rtree::node_d_mem_static_tag>>".
    1>          with
    1>          [
    1>              IndexableGetter=boost::geometry::index::indexable<value>
    1>  ,            EqualTo=boost::geometry::index::equal_to<value>
    1>  ,            Value=value
    1>          ]
    1>          c:\mein\Pfad\boost_1_55_0\boost\geometry\index\rtree.hpp(1281): Bei der Kompilierung der  Klassen-template der void boost::geometry::index::rtree<value,boost::geometry::index::quadratic<16,4>,boost::geometry::index::indexable<Value>,boost::geometry::index::equal_to<Value>,std::allocator<Value>>::raw_destroy(boost::geometry::index::rtree<Value,boost::geometry::index::quadratic<16,4>,boost::geometry::index::indexable<Value>,boost::geometry::index::equal_to<Value>,std::allocator<Value>> &)-Memberfunktion
    1>          with
    1>          [
    1>              Value=value
    1>          ]
    1>          c:\mein\Pfad\boost_1_55_0\boost\geometry\index\rtree.hpp(309): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "void boost::geometry::index::rtree<value,boost::geometry::index::quadratic<16,4>,boost::geometry::index::indexable<Value>,boost::geometry::index::equal_to<Value>,std::allocator<Value>>::raw_destroy(boost::geometry::index::rtree<Value,boost::geometry::index::quadratic<16,4>,boost::geometry::index::indexable<Value>,boost::geometry::index::equal_to<Value>,std::allocator<Value>> &)".
    1>          with
    1>          [
    1>              Value=value
    1>          ]
    1>          d:\entwicklung\consoleapplication1\consoleapplication1\main.cpp(24): Siehe Verweis auf die Instanziierung der gerade kompilierten Klassen-template "boost::geometry::index::rtree<value,boost::geometry::index::quadratic<16,4>,boost::geometry::index::indexable<Value>,boost::geometry::index::equal_to<Value>,std::allocator<Value>>".
    1>          with
    1>          [
    1>              Value=value
    1>          ]
    ========== Erstellen: 0 erfolgreich, 1 fehlerhaft, 0 aktuell, 0 ├╝bersprungen ==========
    

    Lege ich kein Objekt vom rtree an, so gibt es auch keine Probleme ­čśĽ Ich verstehe die Fehlermeldungen nicht, kann hier jemand helfen ­čśĽ



  • <utility> f├╝r pair fehlt. Vielleicht hilfts.

    Ansonsten: mit VS 9.0 und boost 1.54 l├Ąsst es sich so ├╝bersetzen.



  • manni66 schrieb:

    <utility> f├╝r pair fehlt. Vielleicht hilfts.

    Ansonsten: mit VS 9.0 und boost 1.54 l├Ąsst es sich so ├╝bersetzen.

    Also auch mit utility gehts nicht.

    Habe Visual Studio Ultimate 2013 (12.0.30501.00 Update2) mit Boost 1.55.

    Kann hier jemand mit gleicher Konfiguration versuchen, obigen Schnippsel zu kompilieren?



  • Ich habe es mal schnell mit g++ kompiliert: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2

    Keine Fehlermeldung hier !


Log in to reply