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
33
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
  • 19,816
  • 21
  • 96
  • 220
18
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
  • 4,296
  • 6
  • 44
  • 65
14
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
  • 547
  • 1
  • 6
  • 17
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,484
  • 3
  • 29
  • 32
8
votes
2 answers

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
  • 179
  • 1
  • 1
  • 8
8
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
  • 1,021
  • 1
  • 9
  • 32
8
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).
7
votes
1 answer

What the difference between google.protobuf.Any and google.protobuf.Value?

I want th serialize int/int64/double/float/uint32/uint64 into protobuf, which one should I use ? which one is more effective ? For example : message Test { google.protobuf.Any any = 1; // solution 1 google.protobuf.Value value = 2; …
oyjh
  • 1,248
  • 1
  • 9
  • 20
7
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,896
  • 19
  • 48
7
votes
2 answers

Install older version of protobuf via vcpkg

I installed protobuf via vcpkg vcpkg install protobuf:x64-windows. Apparently it installs the latest version (3.6.1). For the project I need version<=3.5.1. Is there any way to install it using vcpkg? For now I just built 3.5.1 using cmake but…
Edwin Paco
  • 121
  • 2
  • 7
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
  • 143
  • 3
  • 10
7
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,964
  • 5
  • 30
  • 45
6
votes
4 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
  • 4,643
  • 6
  • 31
  • 49
6
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
  • 3,775
  • 8
  • 39
  • 79
1
2 3
13 14