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.

145 questions
25
votes
3 answers

Can protobuf service method return primitive type?

I'm trying to use Google protobuf and i 'm having the next descriptions: message.proto file: message Request { required int32 id = 1; optional string value = 2; } service.proto file: import "message.proto"; service Service { rpc request…
4ntoine
  • 17,607
  • 16
  • 70
  • 175
16
votes
2 answers

Unable to get IntelliJ to recognize proto compiled Java class files

We have a build.xml in our project, but IntelliJ is unable to import from it. I get a: Cannot import anything from /build.xml file. On Eclipse I can do a: File -> Import -> General -> Existing Projects into workspace. and chose top-level…
Siddhartha
  • 3,899
  • 6
  • 40
  • 61
14
votes
1 answer

install caffe on mac " Error: invalid option: --with-python"

when I install the caffe on mac according to : Remaining dependencies, with / without Python # with Python pycaffe needs dependencies built from source brew install --build-from-source --with-python -vd protobuf brew install --build-from-source -vd…
pf wang
  • 141
  • 1
  • 3
9
votes
3 answers

Does Protocol Buffers support move constructor

I've checked the move constructor spec and a Message constructor source and didn't find one. If there's not, does anyone know about a plan to add it? I'm using proto3 syntax, writing a library and considering between return through value vs…
Paweł Szczur
  • 5,078
  • 2
  • 26
  • 30
8
votes
1 answer

Does repeated fields in protobuffers keep the order they are inserted?

Consider the following message. message example { repeated string text; } Let's say that in C++ I have a list of string that I insert into the text field of example: exemple aMessage; std::list aList = ... ; for (std::string…
Alperen AYDIN
  • 467
  • 6
  • 14
7
votes
3 answers

Compilation error in compiling Protobufs in Java using SBT build tool

I am using the Play framework (which uses SBT build tool) with Java where I need to consume a Protobuf. So I have xxx.proto file. I got binary protoc compiler and added to class path. so I see - protoc --version libprotoc 3.1.0 I have compiled the…
Richa Gupta
  • 113
  • 2
  • 8
6
votes
2 answers

Will anyone help me debug "proto descriptor was previously loaded" from Google Ads API

I'm getting this error when running this code: $googleAdsClient->getGoogleAdsServiceClient()->search($customerId, $query, $page_size); ERROR message: proto descriptor was previously loaded (included in multiple metadata bundles?):…
Chris
  • 3,786
  • 4
  • 22
  • 37
6
votes
1 answer

fatal error: google/protobuf/port_def.inc: No such file or directory #include

I have windows. And I want to create an C++ op using library tensorflow. From this site https://www.tensorflow.org/guide/extend/op#compile_the_op_using_your_system_compiler_tensorflow_binary_installation I understood that I should do…
NN_05
  • 119
  • 1
  • 7
5
votes
1 answer

Google.Protobuf dose not allow null for properties

I am using GRPC on top of ASPNETCore, also have a model like this: syntax = "proto3"; message Blob { string id = 1; string path = 2; } The problem is that when i try to set the path property to null, It throws an ArgumentException. simply…
SHM
  • 1,768
  • 16
  • 37
5
votes
3 answers

CMake can't find Protobuf `protobuf_generate_cpp`

Using find_package(Protobuf REQUIRED PATHS ${PROTOBUF_SEARCH_PATH} ) if (NOT ${Protobuf_FOUND}) message( FATAL_ERROR "Could not find Protobuf!" ) endif() protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS Foo.proto) I am getting an error…
carobnodrvo
  • 911
  • 8
  • 26
5
votes
2 answers

Deep-copying with ProtoBuf in C/C++

Say I had an array of pointers, each of which points to structs which may once again have pointers to other structs in them; is it possible to handle serializing this using protobuf? If so, how? Any help would be greatly appreciated.
Roney Michael
  • 3,846
  • 4
  • 27
  • 45
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

Protobuf C++ message with google timestamp leads to seg fault

I am new to using google protobuffers and I created a basic message: message msg { uint32 id = 1; google.protobuf.Timestamp timestamp = 2; } Now I created a small c++ program to use this [with the necessary…
Mike
  • 2,543
  • 3
  • 22
  • 53
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
  • 540
  • 6
  • 17
4
votes
1 answer

how to define repeated field as required in google protocol buffer?

how to define repeated field as required in Google protocol buffer?I have a field that modifier is repeated(repeated int32 A ).How i add required modifier to this field? in fact i want to have both modifier(required and repeated).
1
2 3
9 10