Boost C++ Libraries: Ticket #139: read_graphviz https://svn.boost.org/trac10/ticket/139 <pre class="wiki">When a dot file contains "graph" attributes (a=b): digraph G { graph [a=b]; a [c=d]; } The parser will croak the _second_ time it is called: using namespace boost; GraphvizDigraph g_dot, g_dot2, g_dot3; read_graphviz("tmp.dot", g_dot); read_graphviz("tmp.dot", g_dot2); //kaboom Gordon. schmoo@oceanfree.net PS. A "real" dot file that this happens with: digraph G { node [label="\N", shape=box]; graph [bb="0,0,54,124"]; 0 [label=One, pos="27,98", width="0.75", height="0.50"]; 1 [label=Two, pos="27,26", width="0.75", height="0.50"]; 0 -&gt; 1 [pos="e,27,44 27,80 27,72 27,63 27,54"]; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/139 Trac 1.4.3 nobody Mon, 11 Aug 2003 08:25:11 GMT <link>https://svn.boost.org/trac10/ticket/139#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/139#comment:1</guid> <description> <pre class="wiki">Logged In: NO It seems that a static variable must be reinitialized. *************** void read_graphviz(const std::string&amp; filename, GRAPHVIZ_GRAPH&amp; g) { FILE* file = fopen(filename.c_str(), "r"); bgl_dir_restart(file); void* in = static_cast&lt;void*&gt;(file); + if(1){//for debug + using namespace graphviz; + std::cerr&lt;&lt;current_vertex&lt;&lt;","&lt;&lt;current_edge&lt;&lt;","&lt;&lt;current_graph + &lt;&lt;","&lt;&lt;previous_graph&lt;&lt;","&lt;&lt;vlist.size()&lt;&lt;","&lt;&lt;attributes.size()&lt;&lt;"," + &lt;&lt;attribute_state&lt;&lt;","&lt;&lt;subgraphs.size()&lt;&lt;","&lt;&lt;nodes.size()&lt;&lt;"\n"; + } + graphviz::nodes.clear(); //a hasty fix yyparse(static_cast&lt;void*&gt;(&amp;g)); } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Mon, 26 Jan 2004 09:22:06 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/139#comment:2 https://svn.boost.org/trac10/ticket/139#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=321498 Should be fixed now. </pre> Ticket