Questions tagged [protobuf-c]

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data

in this context, protobuf-c is strong related to c because the automatically generated code is C headers and implementation.

From the official site:

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think 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.

205 questions
6
votes
1 answer

Representing pointer variables in protobuf-c

I am not sure how to represent pointers in protobuf-c. When there is a structure like the following struct EXAMPLE1 { int32 x; int32 *y; }; how would I represent the pointer variable (y) in protobuf-c? message EXAMPLE1 { int32 x; …
brokendreams
  • 827
  • 2
  • 10
  • 29
5
votes
1 answer

bazel recompiles protobuf more than necessary

I followed this example, and it works fine. But sometimes (not always) when I changed some application level code that's totally not related to protobuf and rebuild, bazel spends all its time recompiling protobuf. Any suggestions what I can try to…
bill
  • 650
  • 8
  • 17
5
votes
1 answer

Changing an element of an existing protobuf message in C++

I was just wondering, why anybody hasn't gone through the problem I recently have in connection with google protobufs, but after extensive googling, reading the documentation of google's manual page and searching in Stackoverflow-DB, I did not found…
Weana
  • 123
  • 1
  • 2
  • 11
4
votes
1 answer

Handling enum value 0 in protobuf c++

I'm working on a C++17 project that uses protobuf for data serialization, but I come across a problem. I tried to serialize an object defined in protobuf into std::string and the object has only one enum field, when accidentally the value of the…
Neo Hugh
  • 53
  • 1
  • 5
4
votes
0 answers

Protobuf: What if value given to enum does not exist in the set of enums?

Problem Description I added the following enum structure to my protobuf: enum FooType { INVALID = 0; OW = 1; RT = 2; OJ = 3; MC = 4; } [...] optional FooType foo_type = 22 [default = INVALID]; What…
Hani Gotc
  • 840
  • 11
  • 24
4
votes
0 answers

C++: grpc send data with proto defined on runtime

I have the need to define proto fields of a message on runtime and send data along with them. So what I've done is I've defined them on runtime using FieldDescriptorProto and send it from server to client. My proto file looks like this: syntax =…
4
votes
1 answer

Using protobuf objects as key in the std::map

I'm new to the concept of protocol buffers and have a task at hand that can be resolved if I use the protobuf object as keys in the std::map. I know to be able to use protobuf object as key, I need to provide a custom comparator to the std::map to…
Ashutosh
  • 529
  • 5
  • 15
4
votes
1 answer

How do I create .so files with all libraries statically linked into it?

I want to create a .so file with all libraries (GMP and PROTOBUF) statically linked into it so that it can be used in other systems without installing those libraries. This is what I did for MAC: gcc -I /usr/local/include -shared -o xyz.so -g xyz.c…
user3219492
  • 774
  • 1
  • 10
  • 18
4
votes
1 answer

How to integrate/install latest c++ protobuf (3.2) with Android NDK?

The earlier protobuf version 3.0 was easily integrated. But there are issues with the latest version 3.2. It simply compiles & builds all the un-related Android .cc file components as well. If we follow the path to latest branch in git for c++ proto…
iammilind
  • 68,093
  • 33
  • 169
  • 336
4
votes
1 answer

-bash: protoc: command not found

I am using my mac Version :OSX El Capital 10.11.6 I tried this command protoc --version its not working and I did this steps : 1. brew uninstall --devel protobuf 2. brew link libtool 3. brew install --devel protobuf and not working is there any…
Beko Dam
  • 41
  • 1
  • 5
4
votes
1 answer

google protocol buffer wire type start group and end group usage

Trying to parse a message from a server which passes wire type as Start Group . I am using protobuf-c lib in which start group and end group are unsupported (Latest).Is there any examples how to work with wire type as start group so that can parse…
user3232919
  • 83
  • 1
  • 6
3
votes
0 answers

Difference between Arena::CreateMessage and Arena::CreateMaybeMessage

When I using Protocol Buffer with Arena, what is the difference between those 2 functions google::protobuf::Arena::CreateMaybeMessage(); And google::protobuf::Arena::CreateMessage();
Polo1990
  • 89
  • 3
3
votes
0 answers

Dependent proto buffer files produces a "descriptor_table_**_2eproto" has not been declared error

So, I am trying to compile a set of .proto files with the cmake function protobuf_generate_cpp, all of them in the same folder, and some dependent on others. The idea is to create a static library that let me use the messages in other…
adiego73
  • 189
  • 1
  • 3
  • 13
3
votes
1 answer

Google gRPC - Failed to parse binary descriptor

My code is working fine on Dev server but throws Error on Staging server, am I missing anything on Staging? Error: Fatal Error (1): Failed to parse binary descriptor in…
rpm
  • 41
  • 3
3
votes
0 answers

protobuf: detailed error message when using JsonStringToMessage

I want to know if it is possible to get a more detailed error message when converting a JSON string to a protobuf. For example, if field foobar in the JSON is not defined in protobuf, I want the error_message() to tell me that "field foobar is not…
sxy390
  • 31
  • 1
1
2
3
13 14