BUG: example boost_file_dependencies.cpp does not compile.

Hi, I have tried to compile the example boost_file_dependencies.cpp using version 1.33.1 under Linux (gcc) and Windows XP (VC 7.1) and get the same errors. It does not like the following call to dijkstra_shortest_paths_no_init(). If I commit this function out it compiles fine. Any ideas on how to fix this? // Run best-first-search from each vertex with zero in-degree. for (tie(i, iend) = vertices(g); i != iend; ++i) { if (in_degree[*i] == 0) { std::vector<graph_traits<Graph>::vertex_descriptor> pred(num_vertices(g)); property_map<Graph, vertex_index_t>::type indexmap = get(vertex_index, g); dijkstra_shortest_paths_no_init (g, *i, &pred[0], &time[0], weight, indexmap, compare, combine, 0, // Since we are using > instead of >, we (std::numeric_limits<int>::max)(), // flip 0 and inf. default_dijkstra_visitor()); } } List of some of the output. Compiling... boost_file_dependencies.cpp c:\Boost\include\boost-1_33_1\boost\property_map.hpp(25) : error C2039: 'key_type' : is not a member of 'boost::dijkstra_visitor<>' c:\Boost\include\boost-1_33_1\boost\graph\breadth_first_search.hpp(61) : see reference to class template instantiation 'boost::property_traits<PA>' being compiled with [ PA=boost::dijkstra_visitor<> ] c:\Boost\include\boost-1_33_1\boost\graph\dijkstra_shortest_paths.hpp(207) : see reference to function template instantiation 'void boost::breadth_first_visit<VertexListGraph,MutableQueue,boost::detail::dijks tra_bfs_visitor<UniformCostVisitor,UpdatableQueue,WeightMap,PredecessorMap,D istanceMap,BinaryFunction,BinaryPredicate>,ColorMap>(const IncidenceGraph &,boost::graph_traits<G>::vertex_descriptor,Buffer &,BFSVisitor,ColorMap)' being compiled with [ VertexListGraph=Graph, UniformCostVisitor=std::numeric_limits<int>::_Ty, UpdatableQueue=MutableQueue, WeightMap=boost::property_map<Graph,boost::edge_weight_t>::type, PredecessorMap=__w64 unsigned int *__w64 , DistanceMap=int *__w64 , BinaryFunction=boost::closed_plus<int>, BinaryPredicate=std::greater<int>, ColorMap=boost::dijkstra_visitor<>, IncidenceGraph=Graph, G=Graph, Buffer=MutableQueue, BFSVisitor=boost::detail::dijkstra_bfs_visitor<std::numeric_limits<int>::_Ty ,MutableQueue,boost::property_map<Graph,boost::edge_weight_t>::type,__w64 unsigned int *__w64 ,int *__w64 ,boost::closed_plus<int>,std::greater<int>> ] c:\Visual Studio Projects\boost_file_dependencies\boost_file_dependencies\boost_file_dependen cies.cpp(178) : see reference to function template instantiation 'void boost::dijkstra_shortest_paths_no_init<Graph,std::numeric_limits<int>::_Ty,s td::allocator<_Ty>::value_type*__w64 ,std::allocator<int>::value_type*__w64 ,boost::property_map<Graph,Property>::type,boost::property_map<Graph,boost:: vertex_index_t>::type,std::greater<int>,boost::closed_plus<T>,int,boost::dij kstra_visitor<>>(const VertexListGraph &,boost::graph_traits<G>::vertex_descriptor,PredecessorMap,DistanceMap,Weigh tMap,IndexMap,Compare,Combine,DistZero,DijkstraVisitor,ColorMap)' being compiled with [ _Ty=Vertex, Graph=Graph, Property=boost::edge_weight_t, T=int, VertexListGraph=Graph, G=Graph, PredecessorMap=std::allocator<Vertex>::value_type *__w64 , DistanceMap=std::allocator<int>::value_type *__w64 , WeightMap=boost::property_map<Graph,boost::edge_weight_t>::type, IndexMap=boost::property_map<Graph,boost::vertex_index_t>::type, Compare=std::greater<int>, Combine=boost::closed_plus<int>, DistZero=int, DijkstraVisitor=std::numeric_limits<int>::_Ty, ColorMap=boost::dijkstra_visitor<> ] c:\Boost\include\boost-1_33_1\boost\property_map.hpp(25) : error C2146: syntax error : missing ';' before identifier 'key_type' c:\Boost\include\boost-1_33_1\boost\property_map.hpp(26) : error C2039: 'value_type' : is not a member of 'boost::dijkstra_visitor<>' c:\Boost\include\boost-1_33_1\boost\property_map.hpp(26) : error C2146: syntax error : missing ';' before identifier 'value_type' c:\Boost\include\boost-1_33_1\boost\property_map.hpp(27) : error C2039: 'reference' : is not a member of 'boost::dijkstra_visitor<>' c:\Boost\include\boost-1_33_1\boost\property_map.hpp(27) Best regards, Robert McCullough ------------------------------ Software Engineer Promess Incorporated 11429 E. Grand River Brighton, MI. 48116 Phone: 810-229-9334 Fax: 810-229-8125 Email: rob@promessdev.com URL: www.promessinc.com <http://www.promessinc.com/> "Get your facts first and then you can distort them as much as you wish." --- Mark Twain

Hi Robert, On Jan 3, 2006, at 5:02 PM, Robert McCullough wrote:
I have tried to compile the example boost_file_dependencies.cpp using version 1.33.1 under Linux (gcc) and Windows XP (VC 7.1) and get the same errors. It does not like the following call to dijkstra_shortest_paths_no_init(). If I commit this function out it compiles fine. Any ideas on how to fix this?
Here's the patch that fixes this example: Index: file_dependencies.cpp =================================================================== RCS file: /cvsroot/boost/boost/libs/graph/example/file_dependencies.cpp,v retrieving revision 1.16 diff -u -r1.16 file_dependencies.cpp --- file_dependencies.cpp 24 Mar 2005 14:54:10 -0000 1.16 +++ file_dependencies.cpp 23 Jan 2006 20:56:18 -0000 @@ -133,7 +133,7 @@ // grouped together { // Set up the necessary graph properties. - vector<int> time(N); + vector<int> time(N, (std::numeric_limits<int>::max)()); typedef vector<int>::iterator Time; property_map<Graph, edge_weight_t>::type weight = get(edge_weight, g); @@ -157,8 +157,8 @@ indexmap = get(vertex_index, g); dijkstra_shortest_paths_no_init (g, *i, &pred[0], &time[0], weight, indexmap, - compare, combine, 0, // Since we are using > instead of >, we - (std::numeric_limits<int>::max)(), // flip 0 and inf. + compare, combine, 0, // Since we are using > instead of <, we + // flip 0 and inf. default_dijkstra_visitor()); } } It's also corrected in Boost CVS. Thanks for reporting this, and my apologies for the looooooooong delay. Doug
participants (2)
-
Doug Gregor
-
Robert McCullough