Boost logo

Boost Users :

Subject: [Boost-users] Fwd: [Graph] Problem with dynamic_properties
From: fokenrute (fokenrute_at_[hidden])
Date: 2010-10-13 17:32:07


Hi everybody, I'm new to BGL and very frustrated beacause I can't make a
proper use of dynamic_properties.
I'm just trying to read a graphviz dot file with read_graphviz and I found a
sample which make use of dynamic_properties
in order to make a proper call to read_grahviz.
Here is the slightly modified sample:

typedef boost::adjacency_list < boost::listS, boost::vecS,
boost::undirectedS > Graph;
typedef boost::graph_traits<Graph>::vertex_descriptor Vertex;
typedef boost::graph_traits<Graph>::vertex_iterator Iterator;

int main(int argc, char **argv)
{
    Graph g;
    std::ifstream input(argv[1]);
    boost::dynamic_properties dp;
    dp.property("node_id", boost::get(boost::vertex_name, g));
    dp.property("weight", boost::get(boost::edge_weight, g));
    boost::read_graphviz(input, g, dp, "id");
    return 0;
}

When I try to compile it, g++ returns lots of cryptic template related error
messages
but I suspect the most relevant part is : no match for 'operator<<' in 'out
<< boost::get...'
I must be doing something wrong, but I can't get it; expect you'll point me
out my mistake
so that I could re-focus on the algorithms instead of these annoying
technical details.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net