boost 高手帮忙看看,vc6上编不过
#include "stdafx.h"
#include <boost/config.hpp>
#include <iostream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/kamada_kawai_spring_layout.hpp>
#include <map>
typedef struct tag_position_t{
float x;
float y;
}position_t;
int main()
{
using namespace boost;
using namespace std;
typedef adjacency_list < vecS, vecS, undirectedS,
property<vertex_distance_t, int>, property < edge_weight_t, int > > Graph;
typedef std::pair < int, int >E;
const int num_nodes = 5;
E edges[] = { E(0, 2), E(1, 3), E(1, 4), E(2, 1), E(2, 3),
E(3, 4), E(4, 0)
};
int weights[] = { 1, 1, 2, 7, 3, 1, 1 };
Graph g(num_nodes);
property_map<Graph, edge_weight_t>::type weightmap = get(edge_weight, g);
for (std::size_t j = 0; j < sizeof(edges) / sizeof(E); ++j)
{
graph_traits<Graph>::edge_descriptor e; bool inserted;
tie(e, inserted) = add_edge(edges[j].first, edges[j].second, g);
weightmap[e] = weights[j];
}
map< position_t, vertex_index_t> position;
kamada_kawai_spring_layout(g, position, weightmap, boost::edge_length(1.0));
return 0;
}
提示4个重载函数都参数不匹配。还有一个重载函数参数个数应该匹配的,但也没什么错误信息。郁闷。
谢谢了!