Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

New Developer
Posts: 10
Registered: ‎07-15-2014
My Device: Z10
My Carrier: Vodafone

Re: Porting Protobuf

After some more tests I can confirm it does work, serializing and deserializing without problems.


I did build boost but I am not sure if it is needed as the unordered library is only headers.

To build it I just followed the github instructions:


 After that the "stage" folder is created with the compiled libraries and headers, and that's the folder to point in CPPFLAGS


I also forgot to mention that to to enable boost in protobuf you must modify "config.h" in protobuf folder after calling configure (every configure call will regenerate this file) to include:

#define HASH_MAP_H <boost/unordered_map.hpp>
#define HASH_NAMESPACE boost
#define HASH_SET_H <boost/unordered_set.hpp>
#define HASH_MAP_CLASS unordered_map
#define HASH_SET_CLASS unordered_set

 and to comment the lines with the previous values of those defines.

Posts: 35
Registered: ‎10-15-2013
My Device: BlackBerry Z30
My Carrier: O2 UK

Re: Porting Protobuf

Great thanks, that's very helpful. 


I can confirm that you don't need to compile boost, you just need to specify the boost root directory in CPPFLAGS. For me this was: 



It's a shame that the config.h file needs rewriting each time you do a build, I tried using config.h.in to hold the modifications but for some reason that didn't work - more investigation required...



Posts: 147
Registered: ‎05-31-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: Bonbon

Re: Porting Protobuf

Most interesting. I'm new to Protobufs, can this lib be used to create a Google Goggles spinoff? Smiley Happy

New Developer
Posts: 10
Registered: ‎07-15-2014
My Device: Z10
My Carrier: Vodafone

Re: Porting Protobuf

Google Protocol Buffers (or protobuf) is a serialization/deserialization library as Apache Thrift.
AFAIK there is no Google public API using protobuf, it is onyly used internally.

The library is really interesting when you have clients in different platorms and languages as you can use the same message definitions for all platforms, with message definition versions with great serialization times and reduced serialized size.