Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Trouble linking read_graphviz
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-01-07 09:55:40


>
> I have been working through the tutorial portion of "The Boost Graph
> Library: User Guide and Reference Manual", and have been unable to get
> example code that includes calls to read_graphviz to link. For example,
> code including this line:
> read_graphviz("figs/ospf-graph.dot", g_dot);
>

>
> However, the test code graphviz.cpp, which has the lines:
>
> std::ifstream in(filename.c_str());
> BOOST_REQUIRE(in);
>
> Graph g;
> dynamic_properties dp;
> dp.property("id", get(vertex_name, g));
> dp.property("weight", get(edge_weight, g));
> BOOST_CHECK(read_graphviz(in, g, dp, "id"));
>
> compiles, links, and runs just fine.
>
> I also tried (desperation) building an earlier version of boost -- 1.34.1
> -- with the same results.
>
> Any ideas what I'm missing and how I might fix it, or what I need to read
> to find out, would be appreciated.
>

I remember having similar problems last time I tried to use the graphviz
stuff. Basically, the "parameter-extracting" version that you're calling
instantiates a function that doesn't really exist, hence the linker error.
You have to be more very specific when calling read_graphviz. and pass in
the istream and a dynamic_properties object. I think you can omit the "id"
string. I think that gave me some problems too.

Andrew Sutton
andrew.n.sutton_at_[hidden]



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