Hi,
I posted a question regarding an error I've received with
boost::transitive_closure() to stackoverflow
(http://stackoverflow.com/questions/8976812/boosttransitive-closure-and-error...).
Since I didn't receive any comments I'm now trying this mailing list.
In short I'm getting an error about a missing function when I'm trying
to compute the transitive closure.
The code in question is ...
-------------
1: #include
2: #include
3: #include
10: boost::adjacency_list > gTC, g = create_CSgraph();
11: boost::transitive_closure(g, gTC);
-------------
... where "ContainerStruct" is a structure for holding various data and
create_CSgraph() is a function for initializing a graph object.
The error I'm getting is...
-------------
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/depth_first_search.hpp:
In function ‘void boost::depth_first_search(const VertexListGraph&,
const boost::bgl_named_params&) [with VertexListGraph =
std::vector, std::allocator > >, P =
boost::topo_sort_visitor > >, T =
boost::graph_visitor_t, R =
boost::bgl_named_params]’:
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/topological_sort.hpp:65:
instantiated from ‘void boost::topological_sort(VertexListGraph&,
OutputIterator, const boost::bgl_named_params&) [with
VertexListGraph = std::vector, std::allocator > >, OutputIterator =
std::back_insert_iterator >, P =
boost::typed_identity_property_map<long unsigned int>, T =
boost::vertex_index_t, R = boost::no_property]’
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/transitive_closure.hpp:120:
instantiated from ‘void boost::transitive_closure(const Graph&,
GraphTC&, G_to_TC_VertexMap, VertexIndexMap) [with Graph =
boost::adjacency_list, boost::no_property, boost::no_property,
boost::listS>, GraphTC = boost::adjacency_list, boost::no_property, boost::no_property,
boost::listS>, G_to_TC_VertexMap = boost::iterator_property_map, long unsigned int>, long unsigned
int, long unsigned int&>, VertexIndexMap =
boost::vec_adj_list_vertex_id_map, long unsigned int>]’
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/transitive_closure.hpp:263:
instantiated from ‘void boost::transitive_closure(const Graph&,
GraphTC&) [with Graph = CFG, GraphTC = CFG]’
test.C:11: instantiated from here
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/depth_first_search.hpp:291:
error: no matching function for call to ‘vertices(const
std::vector, std::allocator > >&)’
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/topological_sort.hpp:65:
instantiated from ‘void boost::topological_sort(VertexListGraph&,
OutputIterator, const boost::bgl_named_params&) [with
VertexListGraph = std::vector, std::allocator > >, OutputIterator =
std::back_insert_iterator >, P =
boost::typed_identity_property_map<long unsigned int>, T =
boost::vertex_index_t, R = boost::no_property]’
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/transitive_closure.hpp:120:
instantiated from ‘void boost::transitive_closure(const Graph&,
GraphTC&, G_to_TC_VertexMap, VertexIndexMap) [with Graph =
boost::adjacency_list, boost::no_property, boost::no_property,
boost::listS>, GraphTC = boost::adjacency_list, boost::no_property, boost::no_property,
boost::listS>, G_to_TC_VertexMap = boost::iterator_property_map, long unsigned int>, long unsigned
int, long unsigned int&>, VertexIndexMap =
boost::vec_adj_list_vertex_id_map, long unsigned int>]’
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/transitive_closure.hpp:263:
instantiated from ‘void boost::transitive_closure(const Graph&,
GraphTC&) [with Graph = CFG, GraphTC = CFG]’
test.C:11: instantiated from here
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/depth_first_search.hpp:297:
error: no matching function for call to ‘vertices(const
std::vector, std::allocator > >&)’
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/named_function_params.hpp:
In static member function ‘static
boost::shared_array_property_map::type,
boost::vertex_index_t, Graph,
boost::detail::parameter_exists::value>::result_type>::type>
boost::detail::map_maker_helper::make_map(const Graph&, Value, const PM&, const ArgPack&) [with
Graph = std::vector, std::allocator > >, ArgPack =
boost::parameter::aux::arg_list > > >,
boost::parameter::aux::arg_list,
boost::parameter::aux::empty_arg_list> >, Value =
boost::default_color_type, PM = int]’:
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/named_function_params.hpp:520:
instantiated from ‘static typename
boost::detail::map_maker_helper::has_map, Graph, ArgPack, ValueType, typename
boost::remove_const::type>::type>::map_type boost::detail::map_maker::make_map(const Graph&, const ArgPack&,
ValueType) [with Graph = std::vector, std::allocator > >, ArgPack =
boost::parameter::aux::arg_list > > >,
boost::parameter::aux::arg_list,
boost::parameter::aux::empty_arg_list> >, MapTag =
boost::graph::keywords::tag::color_map, ValueType =
boost::default_color_type]’
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/named_function_params.hpp:535:
instantiated from ‘typename boost::detail::map_maker::map_type
boost::detail::make_property_map_from_arg_pack_gen::operator()(const Graph&, const ArgPack&) const [with Graph =
std::vector, std::allocator > >, ArgPack =
boost::parameter::aux::arg_list > > >,
boost::parameter::aux::arg_list,
boost::parameter::aux::empty_arg_list> >, MapTag =
boost::graph::keywords::tag::color_map, ValueType =
boost::default_color_type]’
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/depth_first_search.hpp:297:
instantiated from ‘void boost::depth_first_search(const
VertexListGraph&, const boost::bgl_named_params&) [with
VertexListGraph = std::vector, std::allocator > >, P =
boost::topo_sort_visitor > >, T =
boost::graph_visitor_t, R =
boost::bgl_named_params]’
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/topological_sort.hpp:65:
instantiated from ‘void boost::topological_sort(VertexListGraph&,
OutputIterator, const boost::bgl_named_params&) [with
VertexListGraph = std::vector, std::allocator > >, OutputIterator =
std::back_insert_iterator >, P =
boost::typed_identity_property_map<long unsigned int>, T =
boost::vertex_index_t, R = boost::no_property]’
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/transitive_closure.hpp:120:
instantiated from ‘void boost::transitive_closure(const Graph&,
GraphTC&, G_to_TC_VertexMap, VertexIndexMap) [with Graph =
boost::adjacency_list, boost::no_property, boost::no_property,
boost::listS>, GraphTC = boost::adjacency_list, boost::no_property, boost::no_property,
boost::listS>, G_to_TC_VertexMap = boost::iterator_property_map, long unsigned int>, long unsigned
int, long unsigned int&>, VertexIndexMap =
boost::vec_adj_list_vertex_id_map, long unsigned int>]’
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/transitive_closure.hpp:263:
instantiated from ‘void boost::transitive_closure(const Graph&,
GraphTC&) [with Graph = CFG, GraphTC = CFG]’
test.C:11: instantiated from here
/home/lidman/boost_1_48_0/BUILD/include/boost/graph/named_function_params.hpp:499:
error: no matching function for call to ‘num_vertices(const
std::vector, std::allocator > >&)’
-------------
From this page
(http://boost.2283326.n4.nabble.com/Problem-in-using-Transitive-closure-on-Li...),
I learned that including "boost/graph/vector_as_graph.hpp" before
"boost/graph/transitive_closure.hpp" might do the trick. Unfortunately
that doesn't seem to help me.
For completeness I'm using GCC 4.1.2 20080704 (Red Hat 4.1.2-51) and
Boost 1.48.0 on a x86_64 linux machine.
GCC 4.5.0 seems to give me the same error message.
Is there a newer workaround for this problem?
Best regards,
Jacob Lidman