Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] What's the problem when the dijkstra_shortest_paths is used with stanford_graph
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-05-22 14:15:30


On Sat, 22 May 2010, smallpang smallpang wrote:

> dear everyone
>
> I want to construct multicast tree base on the network topology generated by the stanford graph.
> The source code below can run without error, and have the right output:
> The file is open!
> m:28
> n:10
>
> But when I add the algrithom dijkstra_shortest_paths.
> The error messages show as below:
> Description    Resource    Path    Location    Type
> no matching function for call to ‘num_vertices(Graph* const&)’ MulticastTree2 line 190,
> external location: /usr/include/boost/graph/dijkstra_shortest_paths.hpp    C/C++ Problem
> Description    Resource    Path    Location    Type
> no matching function for call to ‘out_edges(Vertex*&, Graph* const&)’  MulticastTree2 line 76,
> external location: /usr/include/boost/graph/breadth_first_search.hpp    C/C++ Problem
> Description    Resource    Path    Location    Type
> no matching function for call to ‘vertices(Graph* const&)’ MulticastTree2 line 375,
> external location: /usr/include/boost/graph/dijkstra_shortest_paths.hpp    C/C++ Problem
>
> I find the num_vertices\out_edges\vertices are redefined in the stanford_graph.hpp.
> So I change the order of the include files as below:
> #include <boost/graph/stanford_graph.hpp>
> #include <boost/graph/dijkstra_shortest_paths.hpp>
>
> The errors above disappear, and New errors come up:
> Description    Resource    Path    Location    Type
> ‘g’ was not declared in this scope    MulticastTree2        line 408,
> external location: /usr/include/boost/graph/named_function_params.hpp    C/C++ Problem
> Description    Resource    Path    Location    Type
> ‘t’ was not declared in this scope    MulticastTree2        line 408,
> external location: /usr/include/boost/graph/named_function_params.hpp    C/C++ Problem
> Description    Resource    Path    Location    Type
> ‘u’ was not declared in this scope    MulticastTree2        line 463,
> external location: /usr/include/boost/pending/relaxed_heap.hpp    C/C++ Problem
> Description    Resource    Path    Location    Type
> expected ‘,’ or ‘...’ before ‘.’ token    MulticastTree2        line 402,
> external location: /usr/include/boost/graph/named_function_params.hpp    C/C++ Problem
> Description    Resource    Path    Location    Type
> expected initializer before ‘.’ token    MulticastTree2        line 462,
> external location: /usr/include/boost/pending/relaxed_heap.hpp    C/C++ Problem
>
> It's confusing for me, can you tell me what's the problem is
> and any way i can try to solve the problems above.

It looks like (for the second include order) that many places in BGL use
Graph as a template parameter name, so that is likely the problem there;
please use the first ordering. For the first one, that may be fixable by
using "const Graph*" as the type of your graph object (and changing the
rest of the Graph*'s to that as well). See if that changes any of the
errors.

-- Jeremiah Willcock


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net