How to use graphviz neato from within C++ program
<p><a href="https://stackoverflow.com/questions/37608482/how-to-display-grid-graph-using-boost">Contination of this question</a> </p>

<pre><code>#include &lt;boost/graph/graphviz.hpp&gt;
#include &lt;boost/graph/grid_graph.hpp&gt;
typedef boost::grid_graph&lt;2&gt; Grid;
int main()
{
    boost::array&lt;std::size_t, 2&gt; lengths = { { 3, 5 } };
    Grid grid(lengths);
    std::ofstream gout;
    gout.open("test.dot");
    boost::write_graphviz(gout, grid);

}
</code></pre>

<p>I run </p>

<pre><code>system('neato -Tpng overlap=false test.dot &gt; test.png');
</code></pre>

<p>from a c++ program. It is not working.i.e png file is not created</p>

<p>When I run the same command from a console prompt, it does work as expected.</p>