mapbox / mapnik-vector-tile

Mapnik implemention of Mapbox Vector Tile specification
BSD 3-Clause "New" or "Revised" License
552 stars 117 forks source link

build error (box2d.hpp changed location) #261

Closed remster closed 6 years ago

remster commented 6 years ago

with the basic flow: clone + make

In file included from ../src/vector_tile_raster_clipper.cpp:1:0:
../src/vector_tile_raster_clipper.hpp:8:10: fatal error: mapnik/geometry/box2d.hpp: No such file or directory
 #include <mapnik/geometry/box2d.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~

when i fix the location of box2d.hpp this is immediately followed with:

In file included from ../src/vector_tile_processor.ipp:6:0,
                 from ../src/vector_tile_processor.cpp:2:
../src/vector_tile_strategy.hpp: In member function ‘void mapnik::vector_tile_impl::transform_visitor<TransformType, NextProcessor>::operator()(const mapnik::geometry::polygon<double, mapnik::geometry::rings_container>&)’:
../src/vector_tile_strategy.hpp:217:33: error: there are no arguments to ‘begin’ that depend on a template parameter, so a declaration of ‘begin’ must be available [-fpermissive]
         for (auto const& ring : geom)

What seem to be able to see is a version mismatch, the polygon in my mason_packages/.link/include/mapnik/geometry.hpp:

template <typename T, template <typename> class InteriorRings = rings_container>
struct polygon
{
    using coord_type = T;
    using rings_container = InteriorRings<T>;
    linear_ring<T> exterior_ring;
    rings_container interior_rings;

    inline void set_exterior_ring(linear_ring<T> && ring)
    {
        exterior_ring = std::move(ring);
    }

    inline void add_hole(linear_ring<T> && ring)
    {
        interior_rings.emplace_back(std::move(ring));
    }

    inline bool empty() const { return exterior_ring.empty(); }

    inline std::size_t num_rings() const
    {
        return 1 + interior_rings.size();
    }
};

Is not iterable, whilst on mapnik master it migrated to mapbox geometry. Is this a known issue?

flippmoke commented 6 years ago

This should now be fixed in master for use with mapnik v3.1.x -- if you still are using a previous version of mapnik such as v3.0.x series -- please compile with v3.0.x branch here.

flippmoke commented 6 years ago

Also a note, if you update run make distclean before running make again to clear out any old versions of build tools so the changes work properly.