Calling dijkstra_shortest_paths while including boost/graph/graphviz.hpp fails

Hi, when I try to compile the following code it fails, but when I remove the graphviz part of the code it works just fine. Below I've added both my code and the error I get. Am I doing something wrong, or is this a bug in boost? The method ParseDIMECSGraph::ParseGraph simply parses a DIMECS challenge graph. #include "stdafx.h" #include "ParseDIMECSGraph.h" #include <boost/config.hpp> #include <boost/graph/graphviz.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/dijkstra_shortest_paths.hpp> #include <boost/graph/graph_traits.hpp> using namespace boost; int _tmain(int argc, _TCHAR* argv[]) { typedef adjacency_list<listS, vecS, directedS, no_property, property < edge_weight_t, int >> Graph; typedef graph_traits < Graph >::edge_descriptor edge_descriptor; Graph g = *ParseDIMECSGraph::ParseGraph("sample.gr"); std::ofstream ofs( "test.dot" ); write_graphviz(ofs, g); ofs.flush(); ofs.close(); typedef boost::graph_traits < Graph >::vertex_descriptor Vertex; std::vector<Vertex> predecessor(boost::num_vertices(g)); std::vector<int> distances(boost::num_vertices(g)); Vertex source = vertex(0, g); Vertex target = vertex(5, g); property_map<Graph, edge_weight_t>::type weightmap = get(edge_weight, g); property_map<Graph, vertex_index_t>::type indexmap = get(vertex_index, g); boost::dijkstra_shortest_paths( g, source, &predecessor[0], &distances[0], weightmap, indexmap, std::less<int>(), closed_plus<int>(), (std::numeric_limits<int>::max)(), 0, default_dijkstra_visitor()); return 0; } ------ Build started: Project: kShortestPath, Configuration: Release Win32 ------ 1>Compiling... 1>kShortestPath.cpp 1>C:\Program Files (x86)\boost\boost_1_51\boost/xpressive/detail/utility/sequence_stack.hpp(225) : warning C4996: 'std::fill_n': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' 1> C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\xutility(3073) : see declaration of 'std::fill_n' 1> C:\Program Files (x86)\boost\boost_1_51\boost/xpressive/detail/utility/sequence_stack.hpp(223) : while compiling class template member function 'boost::xpressive::detail::sub_match_impl<BidiIter> *boost::xpressive::detail::sequence_stack<T>::push_sequence(size_t,const T &,boost::xpressive::detail::fill_t)' 1> with 1> [ 1> BidiIter=std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char>>, 1> T=boost::xpressive::detail::sub_match_impl<std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char>>> 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/xpressive/match_results.hpp(96) : see reference to class template instantiation 'boost::xpressive::detail::sequence_stack<T>' being compiled 1> with 1> [ 1> T=boost::xpressive::detail::sub_match_impl<std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char>>> 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/smart_ptr/intrusive_ptr.hpp(96) : see reference to class template instantiation 'boost::xpressive::detail::results_extras<BidiIter>' being compiled 1> with 1> [ 1> BidiIter=std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char>> 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/smart_ptr/intrusive_ptr.hpp(95) : while compiling class template member function 'boost::intrusive_ptr<T>::~intrusive_ptr(void)' 1> with 1> [ 1> T=boost::xpressive::detail::results_extras<std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char>>> 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/xpressive/match_results.hpp(1345) : see reference to class template instantiation 'boost::intrusive_ptr<T>' being compiled 1> with 1> [ 1> T=boost::xpressive::detail::results_extras<std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char>>> 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/xpressive/regex_algorithms.hpp(257) : see reference to class template instantiation 'boost::xpressive::match_results<BidiIter>' being compiled 1> with 1> [ 1> BidiIter=std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char>> 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/graphviz.hpp(71) : see reference to function template instantiation 'bool boost::xpressive::regex_match<std::string,std::_String_const_iterator<_Elem,_Traits,_Alloc>>(BidiRange &,const boost::xpressive::basic_regex<BidiIter> &,boost::xpressive::regex_constants::match_flag_type,void *)' being compiled 1> with 1> [ 1> _Elem=char, 1> _Traits=std::char_traits<char>, 1> _Alloc=std::allocator<char>, 1> BidiRange=std::string, 1> BidiIter=std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char>> 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/graphviz.hpp(262) : see reference to function template instantiation 'std::string boost::escape_dot_string<std::string>(const T &)' being compiled 1> with 1> [ 1> T=std::string 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/graphviz.hpp(290) : see reference to function template instantiation 'void boost::write_graphviz<Graph,VertexPropertiesWriter,EdgePropertiesWriter,GraphPropertiesWriter,boost::vec_adj_list_vertex_id_map<Property,Vertex>>(std::ostream &,const Graph &,VertexPropertiesWriter,EdgePropertiesWriter,GraphPropertiesWriter,VertexID,boost::graph::detail::no_parameter)' being compiled 1> with 1> [ 1> Graph=Graph, 1> VertexPropertiesWriter=boost::default_writer, 1> EdgePropertiesWriter=boost::default_writer, 1> GraphPropertiesWriter=boost::default_writer, 1> Property=boost::no_property, 1> Vertex=__w64 unsigned int, 1> VertexID=boost::vec_adj_list_vertex_id_map<boost::no_property,__w64 unsigned int> 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/graphviz.hpp(301) : see reference to function template instantiation 'void boost::write_graphviz<Graph,boost::default_writer,boost::default_writer,boost::default_writer>(std::ostream &,const Graph &,VertexPropertiesWriter,EdgePropertiesWriter,GraphPropertiesWriter,boost::graph::detail::no_parameter)' being compiled 1> with 1> [ 1> Graph=Graph, 1> VertexPropertiesWriter=boost::default_writer, 1> EdgePropertiesWriter=boost::default_writer, 1> GraphPropertiesWriter=boost::default_writer 1> ] 1> .\kShortestPath.cpp(22) : see reference to function template instantiation 'void boost::write_graphviz<Graph>(std::ostream &,const Graph &,boost::graph::detail::no_parameter)' being compiled 1> with 1> [ 1> Graph=Graph 1> ] 1>C:\Program Files (x86)\boost\boost_1_51\boost/xpressive/detail/utility/sequence_stack.hpp(113) : warning C4996: 'std::fill_n': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' 1> C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\xutility(3073) : see declaration of 'std::fill_n' 1> C:\Program Files (x86)\boost\boost_1_51\boost/xpressive/detail/utility/sequence_stack.hpp(99) : while compiling class template member function 'boost::xpressive::detail::sub_match_impl<BidiIter> *boost::xpressive::detail::sequence_stack<T>::grow_(size_t,const T &)' 1> with 1> [ 1> BidiIter=std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char>>, 1> T=boost::xpressive::detail::sub_match_impl<std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char>>> 1> ] 1>C:\Program Files (x86)\boost\boost_1_51\boost/graph/dijkstra_shortest_paths.hpp(140) : error C2784: 'EdgeIndex boost::detail::get(const boost::detail::csr_edge_index_map<Vertex,EdgeIndex> &,const boost::detail::csr_edge_descriptor<Vertex,EdgeIndex> &)' : could not deduce template argument for 'const boost::detail::csr_edge_index_map<Vertex,EdgeIndex> &' from 'int *__w64 ' 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/detail/compressed_sparse_row_struct.hpp(68) : see declaration of 'boost::detail::get' 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/breadth_first_search.hpp(88) : see reference to function template instantiation 'void boost::detail::dijkstra_bfs_visitor<UniformCostVisitor,UpdatableQueue,WeightMap,PredecessorMap,DistanceMap,BinaryFunction,BinaryPredicate>::gray_target<boost::detail::edge_desc_impl<Directed,Vertex>,const IncidenceGraph>(Edge,Graph &)' being compiled 1> with 1> [ 1> UniformCostVisitor=boost::dijkstra_visitor<>, 1> UpdatableQueue=MutableQueue, 1> WeightMap=boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>, 1> PredecessorMap=__w64 unsigned int *__w64 , 1> DistanceMap=int *__w64 , 1> BinaryFunction=boost::closed_plus<int>, 1> BinaryPredicate=std::less<int>, 1> Directed=boost::directed_tag, 1> Vertex=__w64 unsigned int, 1> IncidenceGraph=Graph, 1> Edge=boost::detail::edge_desc_impl<boost::directed_tag,__w64 unsigned int>, 1> Graph=Graph 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/breadth_first_search.hpp(105) : see reference to function template instantiation 'void boost::breadth_first_visit<IncidenceGraph,Buffer,BFSVisitor,ColorMap,__w64 unsigned int*>(const IncidenceGraph &,SourceIterator,SourceIterator,Buffer &,BFSVisitor,ColorMap)' being compiled 1> with 1> [ 1> IncidenceGraph=Graph, 1> Buffer=MutableQueue, 1> BFSVisitor=boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>,MutableQueue,boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>,__w64 unsigned int *__w64 ,int *__w64 ,boost::closed_plus<int>,std::less<int>>, 1> ColorMap=boost::two_bit_color_map<boost::vec_adj_list_vertex_id_map<boost::no_property,__w64 unsigned int>>, 1> SourceIterator=__w64 unsigned int * 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/dijkstra_shortest_paths.hpp(333) : see reference to function template instantiation 'void boost::breadth_first_visit<Graph,MutableQueue,boost::detail::dijkstra_bfs_visitor<UniformCostVisitor,UpdatableQueue,WeightMap,PredecessorMap,DistanceMap,BinaryFunction,BinaryPredicate>,ColorMap>(const IncidenceGraph &,__w64 unsigned int,Buffer &,BFSVisitor,ColorMap)' being compiled 1> with 1> [ 1> Graph=Graph, 1> UniformCostVisitor=boost::dijkstra_visitor<>, 1> UpdatableQueue=MutableQueue, 1> WeightMap=boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>, 1> PredecessorMap=__w64 unsigned int *__w64 , 1> DistanceMap=int *__w64 , 1> BinaryFunction=boost::closed_plus<int>, 1> BinaryPredicate=std::less<int>, 1> ColorMap=boost::two_bit_color_map<boost::vec_adj_list_vertex_id_map<boost::no_property,__w64 unsigned int>>, 1> IncidenceGraph=Graph, 1> Buffer=MutableQueue, 1> BFSVisitor=boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>,MutableQueue,boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>,__w64 unsigned int *__w64 ,int *__w64 ,boost::closed_plus<int>,std::less<int>> 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/dijkstra_shortest_paths.hpp(385) : see reference to function template instantiation 'void boost::dijkstra_shortest_paths_no_init<VertexListGraph,DijkstraVisitor,PredecessorMap,DistanceMap,WeightMap,IndexMap,Compare,Combine,DistZero,ColorMap>(const Graph &,__w64 unsigned int,PredecessorMap,DistanceMap,WeightMap,IndexMap,Compare,Combine,DistZero,DijkstraVisitor,ColorMap)' being compiled 1> with 1> [ 1> VertexListGraph=Graph, 1> DijkstraVisitor=boost::dijkstra_visitor<>, 1> PredecessorMap=__w64 unsigned int *__w64 , 1> DistanceMap=int *__w64 , 1> WeightMap=boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>, 1> IndexMap=boost::vec_adj_list_vertex_id_map<boost::no_property,__w64 unsigned int>, 1> Compare=std::less<int>, 1> Combine=boost::closed_plus<int>, 1> DistZero=int, 1> ColorMap=boost::two_bit_color_map<boost::vec_adj_list_vertex_id_map<boost::no_property,__w64 unsigned int>>, 1> Graph=Graph 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/dijkstra_shortest_paths.hpp(356) : see reference to function template instantiation 'void boost::dijkstra_shortest_paths<VertexListGraph,DijkstraVisitor,PredecessorMap,DistanceMap,WeightMap,IndexMap,Compare,Combine,DistInf,DistZero,boost::two_bit_color_map<IndexMap>>(const VertexListGraph &,__w64 unsigned int,PredecessorMap,DistanceMap,WeightMap,IndexMap,Compare,Combine,DistInf,DistZero,DijkstraVisitor,ColorMap)' being compiled 1> with 1> [ 1> VertexListGraph=Graph, 1> DijkstraVisitor=boost::dijkstra_visitor<>, 1> PredecessorMap=__w64 unsigned int *__w64 , 1> DistanceMap=int *__w64 , 1> WeightMap=boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>, 1> IndexMap=boost::vec_adj_list_vertex_id_map<boost::no_property,__w64 unsigned int>, 1> Compare=std::less<int>, 1> Combine=boost::closed_plus<int>, 1> DistInf=std::numeric_limits<int>::_Ty, 1> DistZero=int, 1> ColorMap=boost::two_bit_color_map<boost::vec_adj_list_vertex_id_map<boost::no_property,__w64 unsigned int>> 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/dijkstra_shortest_paths.hpp(404) : see reference to function template instantiation 'void boost::dijkstra_shortest_paths<VertexListGraph,DijkstraVisitor,PredecessorMap,DistanceMap,WeightMap,IndexMap,Compare,Combine,DistInf,DistZero,char,boost::detail::unused_tag_type,boost::no_property>(const VertexListGraph &,__w64 unsigned int,PredecessorMap,DistanceMap,WeightMap,IndexMap,Compare,Combine,DistInf,DistZero,DijkstraVisitor,const boost::bgl_named_params<T,Tag> &,boost::graph::detail::no_parameter)' being compiled 1> with 1> [ 1> VertexListGraph=Graph, 1> DijkstraVisitor=boost::dijkstra_visitor<>, 1> PredecessorMap=__w64 unsigned int *__w64 , 1> DistanceMap=int *__w64 , 1> WeightMap=boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>, 1> IndexMap=boost::vec_adj_list_vertex_id_map<boost::no_property,__w64 unsigned int>, 1> Compare=std::less<int>, 1> Combine=boost::closed_plus<int>, 1> DistInf=std::numeric_limits<int>::_Ty, 1> DistZero=int, 1> T=char, 1> Tag=boost::detail::unused_tag_type 1> ] 1> .\kShortestPath.cpp(46) : see reference to function template instantiation 'void boost::dijkstra_shortest_paths<Graph,boost::dijkstra_visitor<>,__w64 unsigned int*__w64 ,int*__w64 ,boost::adj_list_edge_property_map<Directed,Value,Ref,Vertex,Property,Tag>,boost::vec_adj_list_vertex_id_map<boost::no_property,Vertex>,std::less<_Ty>,boost::closed_plus<T>,std::numeric_limits<int>::_Ty,int>(const VertexListGraph &,__w64 unsigned int,PredecessorMap,DistanceMap,WeightMap,IndexMap,Compare,Combine,DistInf,DistZero,DijkstraVisitor)' being compiled 1> with 1> [ 1> Directed=boost::directed_tag, 1> Value=int, 1> Ref=int &, 1> Vertex=__w64 unsigned int, 1> Property=boost::property<boost::edge_weight_t,int>, 1> Tag=boost::edge_weight_t, 1> _Ty=int, 1> T=int, 1> VertexListGraph=Graph, 1> PredecessorMap=__w64 unsigned int *__w64 , 1> DistanceMap=int *__w64 , 1> WeightMap=boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>, 1> IndexMap=boost::vec_adj_list_vertex_id_map<boost::no_property,__w64 unsigned int>, 1> Compare=std::less<int>, 1> Combine=boost::closed_plus<int>, 1> DistInf=std::numeric_limits<int>::_Ty, 1> DistZero=int, 1> DijkstraVisitor=boost::dijkstra_visitor<> 1> ] 1>C:\Program Files (x86)\boost\boost_1_51\boost/graph/dijkstra_shortest_paths.hpp(140) : error C2784: 'EdgeIndex boost::detail::get(const boost::detail::csr_edge_index_map<Vertex,EdgeIndex> &,const boost::detail::csr_edge_descriptor<Vertex,EdgeIndex> &)' : could not deduce template argument for 'const boost::detail::csr_edge_index_map<Vertex,EdgeIndex> &' from 'int *__w64 ' 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/detail/compressed_sparse_row_struct.hpp(68) : see declaration of 'boost::detail::get' 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/breadth_first_search.hpp(45) : see reference to function template instantiation 'void boost::detail::dijkstra_bfs_visitor<UniformCostVisitor,UpdatableQueue,WeightMap,PredecessorMap,DistanceMap,BinaryFunction,BinaryPredicate>::gray_target<boost::detail::edge_desc_impl<Directed,Vertex>,Graph>(Edge,Graph &)' being compiled 1> with 1> [ 1> UniformCostVisitor=boost::dijkstra_visitor<>, 1> UpdatableQueue=MutableQueue, 1> WeightMap=boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>, 1> PredecessorMap=__w64 unsigned int *__w64 , 1> DistanceMap=int *__w64 , 1> BinaryFunction=boost::closed_plus<int>, 1> BinaryPredicate=std::less<int>, 1> Directed=boost::directed_tag, 1> Vertex=__w64 unsigned int, 1> Graph=Graph, 1> Edge=boost::detail::edge_desc_impl<boost::directed_tag,__w64 unsigned int> 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/breadth_first_search.hpp(37) : while compiling class template member function 'void boost::BFSVisitorConcept<Visitor,Graph>::constraints(void)' 1> with 1> [ 1> Visitor=boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>,MutableQueue,boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>,__w64 unsigned int *__w64 ,int *__w64 ,boost::closed_plus<int>,std::less<int>>, 1> Graph=Graph 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/concept/detail/has_constraints.hpp(42) : see reference to class template instantiation 'boost::BFSVisitorConcept<Visitor,Graph>' being compiled 1> with 1> [ 1> Visitor=boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>,MutableQueue,boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>,__w64 unsigned int *__w64 ,int *__w64 ,boost::closed_plus<int>,std::less<int>>, 1> Graph=Graph 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/concept/detail/msvc.hpp(53) : see reference to class template instantiation 'boost::concepts::not_satisfied<Model>' being compiled 1> with 1> [ 1> Model=boost::BFSVisitorConcept<boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>,MutableQueue,boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>,__w64 unsigned int *__w64 ,int *__w64 ,boost::closed_plus<int>,std::less<int>>,Graph> 1> ] 1> C:\Program Files (x86)\boost\boost_1_51\boost/graph/breadth_first_search.hpp(68) : see reference to class template instantiation 'boost::concepts::require<Model>' being compiled 1> with 1> [ 1> Model=boost::BFSVisitorConcept<boost::detail::dijkstra_bfs_visitor<boost::dijkstra_visitor<>,MutableQueue,boost::adj_list_edge_property_map<boost::directed_tag,int,int &,__w64 unsigned int,boost::property<boost::edge_weight_t,int>,boost::edge_weight_t>,__w64 unsigned int *__w64 ,int *__w64 ,boost::closed_plus<int>,std::less<int>>,Graph> 1> ] 1>kShortestPath - 2 error(s), 2 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

On Tue, 18 Dec 2012, Brammert Ottens wrote:
Hi,
when I try to compile the following code it fails, but when I remove the graphviz part of the code it works just fine. Below I've added both my code and the error I get. Am I doing something wrong, or is this a bug in boost? The method ParseDIMECSGraph::ParseGraph simply parses a DIMECS challenge graph.
#include "stdafx.h" #include "ParseDIMECSGraph.h" #include <boost/config.hpp> #include <boost/graph/graphviz.hpp> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/dijkstra_shortest_paths.hpp> #include <boost/graph/graph_traits.hpp>
using namespace boost;
int _tmain(int argc, _TCHAR* argv[]) { typedef adjacency_list<listS, vecS, directedS, no_property, property < edge_weight_t, int >> Graph; typedef graph_traits < Graph >::edge_descriptor edge_descriptor;
Graph g = *ParseDIMECSGraph::ParseGraph("sample.gr");
std::ofstream ofs( "test.dot" ); write_graphviz(ofs, g); ofs.flush(); ofs.close();
typedef boost::graph_traits < Graph >::vertex_descriptor Vertex; std::vector<Vertex> predecessor(boost::num_vertices(g)); std::vector<int> distances(boost::num_vertices(g));
Vertex source = vertex(0, g); Vertex target = vertex(5, g);
property_map<Graph, edge_weight_t>::type weightmap = get(edge_weight, g); property_map<Graph, vertex_index_t>::type indexmap = get(vertex_index, g);
boost::dijkstra_shortest_paths( g, source, &predecessor[0], &distances[0], weightmap, indexmap, std::less<int>(), closed_plus<int>(), (std::numeric_limits<int>::max)(), 0, default_dijkstra_visitor()); return 0; }
This seems to happen often with VC++. Try replacing "&predecessor[0]" by "boost::make_iterator_property_map(predecessor.begin(), get(boost::vertex_index, g))" and the same for "distances" and see if that fixes anything. -- Jeremiah Willcock
participants (2)
-
Brammert Ottens
-
Jeremiah Willcock