Boost logo

Boost Users :

Subject: [Boost-users] Error compiling Boost::graph crs_graph
From: Andrea Cassioli (cassioliandre_at_[hidden])
Date: 2014-02-28 12:33:15


Dear all,
I have been using the compressed_sparse_row_graph quite extensively in
past. Now, I am working under Linux with Boost 1.55 and I am lost trying to
compile the following toy piece of code:

#include <vector>
#include <boost/graph/compressed_sparse_row_graph.hpp>

int main()
{

    typedef boost::compressed_sparse_row_graph<boost::directedS,
boost::no_property, int> gtype;

    std::vector<boost::graph_traits<gtype>::edge_descriptor> edges;
    std::vector< int > distances;

    gtype graph(boost::edges_are_unsorted_t(),
edges.begin(), edges.end(),
distances.begin(), edges.size());

    return 0;
}

Just compile with g++ 4.8.2 and you get

In file included from
/usr/include/boost/graph/detail/compressed_sparse_row_struct.hpp:33:0,
                 from
/usr/include/boost/graph/compressed_sparse_row_graph.hpp:29,
                 from prova_icl.cpp:2:
/usr/include/boost/graph/detail/histogram_sort.hpp: In instantiation of
���void boost::graph::detail::split_into_separate_coords(InputIterator,
InputIterator, std::vector<Property>&, std::vector<Property>&) [with
InputIterator =
__gnu_cxx::__normal_iterator<boost::detail::csr_edge_descriptor<long
unsigned int, long unsigned int>*,
std::vector<boost::detail::csr_edge_descriptor<long unsigned int, long
unsigned int> > >; VerticesSize = long unsigned int]���:
/usr/include/boost/graph/compressed_sparse_row_graph.hpp:466:46: required
from ���boost::compressed_sparse_row_graph<boost::directedS,
VertexProperty, EdgeProperty, GraphProperty, Vertex,
EdgeIndex>::compressed_sparse_row_graph(boost::edges_are_unsorted_t,
InputIterator, InputIterator, EdgePropertyIterator,
boost::compressed_sparse_row_graph<boost::directedS, VertexProperty,
EdgeProperty, GraphProperty, Vertex, EdgeIndex>::vertices_size_type, const
GraphProperty&) [with InputIterator =
__gnu_cxx::__normal_iterator<boost::detail::csr_edge_descriptor<long
unsigned int, long unsigned int>*,
std::vector<boost::detail::csr_edge_descriptor<long unsigned int, long
unsigned int> > >; EdgePropertyIterator =
__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> >
>; VertexProperty = boost::no_property; EdgeProperty = int; GraphProperty =
boost::no_property; Vertex = long unsigned int; EdgeIndex = long unsigned
int; boost::compressed_sparse_row_graph<boost::directedS, VertexProperty,
EdgeProperty, GraphProperty, Vertex, EdgeIndex>::vertices_size_type = long
unsigned int]���
prova_icl.cpp:14:34: required from here
/usr/include/boost/graph/detail/histogram_sort.hpp:226:51: error:
conversion from ���boost::detail::csr_edge_descriptor<long unsigned int,
long unsigned int>��� to non-scalar type ���std::pair<long unsigned int,
long unsigned int>��� requested
     std::pair<VerticesSize, VerticesSize> edge = *begin;

What the xxx is happening? In my understanding sounds like there conversion
from an edge_descriptor to a pair....Any ideas??

Best,
Andrea Cassioli



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