我是Boost图库的新手,我尝试使用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;
}
但我收到了以下错误:
我会非常感谢任何帮助