Thank you for your reply.<div><br>1 The reason for the problem you suggest had been considered in the file &lt;boost/graph/stanford_graph.hpp&gt;, such as<br><i><span class="Apple-style-span" style="font-size: x-small;">namespace boost {<br>
  typedef Graph* sgb_graph_ptr;<br>  typedef const Graph* sgb_const_graph_ptr;</span></i><div><br></div><div>2 There are several reasons I don&#39;t using &quot;const Graph*&quot; as the type of the graph object.</div><div>
(1) I modify the code as below:</div><div><div><i><span class="Apple-style-span" style="font-size: x-small;">    const Graph* inputG;</span></i></div><div><i><span class="Apple-style-span" style="font-size: x-small;">    char *in_filename = &quot;<a href="http://r10-0.gb">r10-0.gb</a>&quot;;</span></i></div>
</div><div>more and more errors come up, I find that the graph object *inputG should be modified in</div><div>the dijkstra_shortest_path algorithm.</div><div>(2) The Graph type point to the const graph object can point to the not const graph such as</div>
<div>inputG (Graph *inputG). </div><div>(3) There are several code samples as I do, such as</div><div><i><span class="Apple-style-span" style="font-size: x-small;"><a href="http://www.boost.org/doc/libs/1_40_0/libs/graph/example/miles_span.cpp">http://www.boost.org/doc/libs/1_40_0/libs/graph/example/miles_span.cpp</a></span></i></div>
<div><i><span class="Apple-style-span" style="font-size: x-small;"><a href="http://www.boost.org/doc/libs/1_40_0/libs/graph/example/dijkstra-example.cpp">http://www.boost.org/doc/libs/1_40_0/libs/graph/example/dijkstra-example.cpp</a></span></i></div>
<div>Additionaly, the oder of include files is likely the second one, such as:</div><div><div><span class="Apple-style-span" style="font-size: x-small;"><i>#include &lt;boost/graph/dijkstra_shortest_paths.hpp&gt;</i></span></div>
<div><span class="Apple-style-span" style="font-size: x-small;"><i>#include &lt;boost/graph/stanford_graph.hpp&gt;</i></span></div></div><div><br></div><div>I have no idea what&#39;s the reason for the problem.</div><div>
<br></div><div><br></div><div>On Sun, May 23, 2010 at 2:15 AM, Jeremiah Willcock &lt;<a href="mailto:jewillco@osl.iu.edu">jewillco@osl.iu.edu</a>&gt; wrote:<br>&gt;<br>&gt; On Sat, 22 May 2010, smallpang smallpang wrote:<br>
&gt;<br>&gt;&gt; dear everyone<br>&gt;&gt;<br>&gt;&gt; I want to construct multicast tree base on the network topology generated by the stanford graph.<br>&gt;&gt; The source code below can run without error, and have the right output:<br>
&gt;&gt; The file is open!<br>&gt;&gt; m:28<br>&gt;&gt; n:10<br>&gt;&gt;<br>&gt;&gt; But when I add the algrithom dijkstra_shortest_paths.<br>&gt;&gt; The error messages show as below:<br>&gt;&gt; Description    Resource    Path    Location    Type<br>
&gt;&gt; no matching function for call to ‘num_vertices(Graph* const&amp;)’ MulticastTree2 line 190,<br>&gt;&gt; external location: /usr/include/boost/graph/dijkstra_shortest_paths.hpp    C/C++ Problem<br>&gt;&gt; Description    Resource    Path    Location    Type<br>
&gt;&gt; no matching function for call to ‘out_edges(Vertex*&amp;, Graph* const&amp;)’  MulticastTree2 line 76,<br>&gt;&gt; external location: /usr/include/boost/graph/breadth_first_search.hpp    C/C++ Problem<br>&gt;&gt; Description    Resource    Path    Location    Type<br>
&gt;&gt; no matching function for call to ‘vertices(Graph* const&amp;)’ MulticastTree2 line 375,<br>&gt;&gt; external location: /usr/include/boost/graph/dijkstra_shortest_paths.hpp    C/C++ Problem<br>&gt;&gt;<br>&gt;&gt; I find the num_vertices\out_edges\vertices are redefined in the stanford_graph.hpp.<br>
&gt;&gt; So I change the order of the include files as below:<br>&gt;&gt; #include &lt;boost/graph/stanford_graph.hpp&gt;<br>&gt;&gt; #include &lt;boost/graph/dijkstra_shortest_paths.hpp&gt;<br>&gt;&gt;<br>&gt;&gt; The errors above disappear, and New errors come up:<br>
&gt;&gt; Description    Resource    Path    Location    Type<br>&gt;&gt; ‘g’ was not declared in this scope    MulticastTree2        line 408,<br>&gt;&gt; external location: /usr/include/boost/graph/named_function_params.hpp    C/C++ Problem<br>
&gt;&gt; Description    Resource    Path    Location    Type<br>&gt;&gt; ‘t’ was not declared in this scope    MulticastTree2        line 408,<br>&gt;&gt; external location: /usr/include/boost/graph/named_function_params.hpp    C/C++ Problem<br>
&gt;&gt; Description    Resource    Path    Location    Type<br>&gt;&gt; ‘u’ was not declared in this scope    MulticastTree2        line 463,<br>&gt;&gt; external location: /usr/include/boost/pending/relaxed_heap.hpp    C/C++ Problem<br>
&gt;&gt; Description    Resource    Path    Location    Type<br>&gt;&gt; expected ‘,’ or ‘...’ before ‘.’ token    MulticastTree2        line 402,<br>&gt;&gt; external location: /usr/include/boost/graph/named_function_params.hpp    C/C++ Problem<br>
&gt;&gt; Description    Resource    Path    Location    Type<br>&gt;&gt; expected initializer before ‘.’ token    MulticastTree2        line 462,<br>&gt;&gt; external location: /usr/include/boost/pending/relaxed_heap.hpp    C/C++ Problem<br>
&gt;&gt;<br>&gt;&gt; It&#39;s confusing for me, can you tell me what&#39;s the problem is<br>&gt;&gt; and any way i can try to solve the problems above.<br>&gt;<br>&gt; 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 &quot;const Graph*&quot; as the type of your graph object (and changing the rest of the Graph*&#39;s to that as well).  See if that changes any of the errors.<br>
&gt;<br>&gt; -- Jeremiah Willcock<br>&gt; _______________________________________________<br>&gt; Boost-users mailing list<br>&gt; <a href="mailto:Boost-users@lists.boost.org">Boost-users@lists.boost.org</a><br>&gt; <a href="http://listarchives.boost.org/mailman/listinfo.cgi/boost-users">http://listarchives.boost.org/mailman/listinfo.cgi/boost-users</a><br>
<br></div></div>

