Comments (7)
it looks like your generated osm pbf files are not in sync with your protobuf lib. How did you install these files? what are the version of all your protobuf related tools (protoc, libs...)
from libosmpbfreader.
Thanks for the expedient response. I am on OS X
- I copied example_routing.cc and osmpbfreader.h.
brew install libosmpbf-dev protobuf
then I ran: g++ example_routing.cc -O2 -losmpbf -lprotobuf -std=c++0x -o routing
and ran into the error.
What protobuf version did you use when creating this? Maybe I can downgrade the brew for protobuf and all will be well.
from libosmpbfreader.
The headers are generated by brew or its build system (I don't know verry well brew).
Here, I use the debian package of debian stable. That's protobuf 3.0.0:
✔ ~$ apt-cache show libosmpbf-dev
Package: libosmpbf-dev
Source: osmpbf
Version: 1.3.3-7
Installed-Size: 588
Maintainer: Debian GIS Project <[email protected]>
Architecture: amd64
Depends: libprotobuf-dev
Description-en: C headers for OpenStreetMap PBF file format
Osmpbf is a Java/C library to read and write OpenStreetMap PBF files.
PBF (Protocol buffer Binary Format) is a binary file format for OpenStreetMap
data that uses Google Protocol Buffers as low-level storage.
.
This package provides the C headers to be used in third-party
applications.
Description-md5: 4efddfc6dce26a29060c007aaeae103b
Homepage: https://github.com/scrosby/OSM-binary
Tag: devel::lang:c++, devel::library, implemented-in::c++, role::devel-lib
Section: libdevel
Priority: extra
Filename: pool/main/o/osmpbf/libosmpbf-dev_1.3.3-7_amd64.deb
Size: 69964
MD5sum: c0af204e007b09c5938f94e6348dc65d
SHA256: 2e88715373753af0cb761dd2e7ee7e7251cb597b645de8395bdcc29513cc9469
✔ ~$ apt-cache show libprotobuf-dev
Package: libprotobuf-dev
Source: protobuf
Version: 3.0.0-9
Installed-Size: 7871
Maintainer: Debian protobuf maintainers <[email protected]>
Architecture: amd64
Depends: zlib1g-dev, libprotobuf10 (= 3.0.0-9), libprotobuf-lite10 (= 3.0.0-9)
Description-en: protocol buffers C++ library (development files)
Protocol buffers are a flexible, efficient, automated mechanism for
serializing structured data - similar to XML, but smaller, faster, and
simpler. You define how you want your data to be structured once, then you can
use special generated source code to easily write and read your structured
data to and from a variety of data streams and using a variety of languages.
You can even update your data structure without breaking deployed programs
that are compiled against the "old" format.
.
Google uses Protocol Buffers for almost all of its internal RPC protocols and
file formats.
.
This package contains the development headers and static libraries needed for
writing C++ applications.
Description-md5: 46508a20bc181591502383b4f00be1a6
Multi-Arch: same
Homepage: https://github.com/google/protobuf/
Tag: devel::lang:c++, devel::library, implemented-in::c++, role::devel-lib
Section: libdevel
Priority: optional
Filename: pool/main/p/protobuf/libprotobuf-dev_3.0.0-9_amd64.deb
Size: 954116
MD5sum: 3f84356ae504c8707910bdafe45beac1
SHA256: e65e18bb9b8df7c36aefc3efe88ee9356e9009555269527f22e4937aa45b857b
✔ ~$
from libosmpbfreader.
The idea would be to install the protobuf version used to generate the osmpbf, thus the one used by brew for generating this package.
from libosmpbfreader.
Thanks for your help. Still running into errors, so I just switched to ubuntu. Works GREAT! Thanks for the library.
quick note, I had to add the zlib library during build, so instead of:
g++ example_routing.cc -O2 -losmpbf -lprotobuf -std=c++0x -o routing
you just add:
g++ example_routing.cc -O2 -losmpbf -lprotobuf -lz -std=c++0x -o routing
from libosmpbfreader.
My platform is CentOS 7. I used the lib64osmpbf-static-devel-1.3.3-1-omv3001.x86_64.rpm
from https://pkgs.org/download/lib64osmpbf-static-devel. My protobuf
version is 3.4.0. But I still met the following error message:
g++ -O3 -std=c++0x -Wall -Wextra -o example_routing example_routing.cc -lprotobuf-lite -losmpbf -lz
In file included from osmpbfreader.h:37:0,
from example_routing.cc:14:
/usr/include/osmpbf/fileformat.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^~~~~
/usr/include/osmpbf/fileformat.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^~~~~
/usr/include/osmpbf/fileformat.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
^~~~~
In file included from osmpbfreader.h:39:0,
from example_routing.cc:14:
/usr/include/osmpbf/osmformat.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^~~~~
/usr/include/osmpbf/osmformat.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^~~~~
/usr/include/osmpbf/osmformat.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
^~~~~
make: *** [example_routing] Error 1
Could you please help me with this?
Thanks a lot.
from libosmpbfreader.
Your osmpbf package must be generated by the same protobuf version that you use to compile. Looks like it's not the case hère.
from libosmpbfreader.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libosmpbfreader.