I'm trying to build a simple GraphML loader using BOOST libraries. I have a GraphML file and I want to load it in a boost adjacency list structure. The graph is directed and the only information that it is stored are the name of the nodes (0,1,2,...) and the edges from one node to another. What I did is:
void loadHierarchy(){
// ...
std::ifstream inFile;
inFile.open("ext.gml", std::ifstream::in);
typedef boost::adjacency_list<> Graph;
Graph g;
boost::read_graphml(inFile, g);
// ...
}
I don't need to use any properties, just to keep the whole graph information in the adjacency list.
The errors that I get are the following:
error: invalid initialization of reference of type
‘boost::mutate_graph&’
from expression of type‘loadHierarchy()::Graph’
/usr/include/boost/graph/graphml.hpp:194: error: in passing argument 2 of
‘void boost::read_graphml(std::istream&, boost::mutate_graph&)’
It should be as simple as that, but apparently it isn't.