mapnik-vector-tile: vector_tile.pb.h:12:2: error: #error This file was generated by a newer version of protoc
Hi, While I tried to make I faced this error
In file included from Release/obj/gen/vector_tile.pb.cc:5:0: Release/obj/gen/vector_tile.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is #error This file was generated by a newer version of protoc which is
I tried both protobuf 3.3.0 and protobuf 3.4.1 but there was not any change, where am I doing wrong?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 34 (14 by maintainers)
@am2222 for some reason the vector tile you are creating is not proper, so this is something during your creation process.
If you had a
std::stringvariable namedbuffer(your vector tile) you would do the following to go the other way back to an image.That function and that part of the code are simply convience functions that we have using from libprotobuf and its created header that I told you we don’t need. If you look at the test case example code I linked after that short set of code that I outlined above all the rest is simply checking the test results. You simply need the
out_tile.get_buffer()<-- the is the resulting vector tile.Use the agg from mapnik: https://github.com/mapnik/mapnik/tree/master/deps/agg If you have mapnik installed correctly, I suggest you use
mapnik-configFor example:
or
@am2222 Have you seen https://github.com/mapbox/tippecanoe ?
Some notes on your code here – you have a lot going on here you don’t need.
First you have no need for
#include <vector_tile.pb.h>– this is the protobuffer stuff we use in our tests only here, you see it sprinkled elsewhere because sometime in the past we moved from libprotobuf -> protozero. Protozero is our specially designed header only library for parsing protobufs and its a lot faster then libprotobuf from google. Drop all the google protobuf code.You really just need to do something like this - https://github.com/mapbox/mapnik-vector-tile/blob/master/test/vector_tile.cpp#L50-L58
@am2222 it is a legacy of the library originally being designed as a header only library, but due to compile times was split out into
hppandippfiles. The library still operates as a header only library for use typically. You can see how this works somewhat at the bottom of hpp files: https://github.com/mapbox/mapnik-vector-tile/blob/master/src/vector_tile_processor.hpp#L209-L211Just write your C++ code and include the
hppfiles you need and it works.@am2222 yes, by default the
makeinstruction sets aPATHvariable that should include your path to abinin themason_packagespath for protoc.I am wondering if perhaps you have a local
protocinstalled and this is causing problems.For example locally for me:
I wonder if you are pulling back a locally installed
protocin this step rather then ours for some reason.Also these can be your friends sometime:
or
Take a look into
Release/obj/gen/vector_tile.pb.h. Also checkapt search protobuf-compiler.I remember I was also facing this error, but cannot remember what was the culprit.
@am2222, what is the version in your
vector_tile.pb.h? Cannot there be some conflict with protobuf-compiler from your system?I see this in my
vector_tile.pb.h, for example:@am2222 could you provide the entire log after you run
make, what version of Linux? I will attempt to replicate on a docker image if I can.@am2222 what OS are you using, does running
makesimply not work. In MVT - only for the tests do we useprotobuflibrary directly.