Hi,
I am using boost 1.33.1 with Visual C++ 2002 (v
7.0.9466) and Windows XP (no service pack).
I was doing some experiments with boost Graph library
.
When running the program i get the following error on
add_edge():
----------------------------------------------------------------------
An unhandled exception of type
'System.TypeLoadException' occurred in test.exe
Additional information: Could not load type
std._Ptritboost::vecS,boost::vecS,boost::bidirectionalS,boost::no_property,boost::no_p...,boost::vecS,boost::vecS,boost::bidirectionalS,boost::no_property,boost::no_property,boost::no_property,boost::listS>::config::stored_vertex,int,boost::detail::adj_list_genboost::vecS,boost::vecS,boost::bidirectionalS,boost::no_property,boost::no_p...,boost::vecS,boost::vecS,boost::bidirectionalS,boost::no_property,boost::no_property,boost::no_property,boost::listS>::config::stored_vertex
*,boost::detail::adj_list_genboost::vecS,boost::vecS,boost::bidirectionalS,boost::no_property,boost::no_p...,boost::vecS,boost::vecS,boost::bidirectionalS,boost::no_property,boost::no_property,boost::no_property,boost::listS>::config::stored_vertex
&,boost::detail::adj_list_gen
#include
#include
using namespace boost;
int main(int,char*[])
{
// create a typedef for the Graph type
typedef adjacency_list
Graph;
// Make convenient labels for the vertices
enum { A, B, C, D, E, N };
const int num_vertices = N;
const char* name = "ABCDE";
// writing out the edges in the graph
typedef std::pair Edge;
Edge edge_array[] =
{ Edge(A,B), Edge(A,D), Edge(C,A), Edge(D,C),
Edge(C,E), Edge(B,D), Edge(D,E) };
const int num_edges =
sizeof(edge_array)/sizeof(edge_array[0]);
// declare a graph object
Graph g(num_vertices);
// add the edges to the graph object
for (int i = 0; i < num_edges; ++i)
{
add_edge(edge_array[i].first, edge_array[i].second,
g);
}
//// get the property map for vertex indices
typedef property_map::type
IndexMap;
IndexMap index = get(vertex_index, g);
std::cout << "vertices(g) = ";
typedef graph_traits<Graph>::vertex_iterator
vertex_iter;
std::pair vp;
for (vp = vertices(g); vp.first != vp.second;
++vp.first)
std::cout << index[*vp.first] << " ";
std::cout << std::endl;
float finish;
std::cin >> finish;
return 0;
}
----------------------------------------------------------------------
Thanks,
João Orvalho