I am new to Boost graph library and I am trying to draw a graph using graphviz.
#include <boost/graph/adjacency_list.hpp> #include <boost/graph/graphviz.hpp> #include <boost/utility.hpp> // for boost::tie #include <iostream> #include <utility> // for std::pair using namespace boost; using namespace std; class V {}; class C {}; void draw_test(){ typedef boost::adjacency_list<boost::listS, boost::listS, boost::bidirectionalS, V, C > MyGraph; typedef boost::graph_traits<MyGraph>::vertex_descriptor vertex_descriptor; MyGraph g; vertex_descriptor a = add_vertex(V(), g); vertex_descriptor b = add_vertex(V(), g); add_edge(a, b, g); write_graphviz(std::cout, g); } int main() { draw_test(); return 0; }
But I got the following error:
http://pastebin.com/KmTyyUHh
I will be very grateful for any help
source share