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
3
votes
1 answer

libprotobuf check failed while executing program on mac os

I have a project that uses protocol buffers and it works fine on linux and windows but on mac os I am getting following error while running the program. I confirmed I am using the correct libraries. I used brew install protobuf to install protocol…
3
votes
0 answers

C++ Protobuf add an already allocated repeated numeric field

I have a simple message which contains lots of repeated numeric fields: syntax = "proto3"; option cc_enable_arenas = true; message bigData{ repeated double info = 1; } During runtime the data arrives already allocated. This is how I attempted…
Dávid Tóth
  • 2,788
  • 1
  • 21
  • 46
3
votes
1 answer

How to compile nanopb .proto file into .h and .c files using nanopb and protobuf (`protoc` compile question)

Old title: How to compile nanopb/examples/simple/simple.proto file into simple.h and simple.c using nanopb and protobuf Regarding this library: https://github.com/nanopb/nanopb My goal is to follow this tutorial:…
Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265
3
votes
0 answers

Protoc import was not found or had errors

I have two simple .proto files. One has an import towards the other. When launching the command; protocols --java_out = 'exit path' -I 'path root' 'path .proto with import'. It throws me the following error: Import "path proto2.proto" was not found…
dfuentes
  • 31
  • 4
3
votes
2 answers

How to add vector to repeated field protobuf c++

I have the following protobuf message : message gen_Journey { repeated gen_ProposedSegment proposedSegments = 1; } the generated cpp is the following // repeated .gen_ProposedSegment proposedSegments = 1; int gen_Journey::proposedsegments_size()…
gringo
  • 373
  • 2
  • 4
  • 15
3
votes
0 answers

Protobuf CMake: PROTOBUF_LIBRARIES, PROTOBUF_INCLUDE_DIRS remains empty

I'm trying to build a protobuf project on Ubuntu using CMake. Protobuf version 3.5.1 was builded on the same machine successfully. To use this specific version, the flag NO_DEFAULT_PATH is passed to find_package and the new location of the protobuf…
johni07
  • 761
  • 1
  • 11
  • 31
3
votes
1 answer

Python API to parse binary file which contains protobuf data in array format

I'm facing problem in parsing binary file containing protobuf data in array format. When I used the python API, ParseFromString output was always zero or none. The serialized protobuf data in the binary file was generated using C++ API,…
Silpa KS
  • 31
  • 3
3
votes
0 answers

Is it possible to restore the .proto file when a message uses package, imports, and field options?

My goal is to restore the lost .proto files written by someone else from existing c++ protobuf messages. By using the Descriptor and EnumDescriptor I was able to do the following: const google::protobuf::EnumDescriptor* logOptionDesc = …
mtkzcs
  • 41
  • 4
2
votes
0 answers

TensorFlow 2.13.0 Protobuf FATAL ERROR on Inference C++ test

I just compiled TensorFlow 2.13.0, on Slackware with kernel 4.19.288 with nvidia Driver Version: 535.54.03 and CUDA Version: 12.2, C++ APIs. When I try to start compiled inference test it gives me this error: [libprotobuf ERROR…
2
votes
1 answer

Go import scope lookup for protobuf types

I'm building a transpiler and need to understand the protobuf/go scope lookup system. I've been trying to google the docs and finding no luck. Q: Is there a shared package scope lookup that you can do when importing Types in Go/protobufs? Here is…
pyramation
  • 1,631
  • 4
  • 22
  • 35
2
votes
1 answer

how to parse only one field from protobuf Serialize byte array

I need only one field from protobuf serialize byte array, but must call parseFrom function, which is low performance. how can I get field offset from byte array, and parse value by offset.
Chronos
  • 69
  • 3
2
votes
1 answer

Protobuf : pass protobuf message from Javascript to C++ WebAssembly module

I would like to pass a protobuf message from Javascript to a C++ WebAssembly module. I do receive, and can successfully parse the simpler protobuf messages on the C++ side, however, protobuf is failing to parse the less-simple protobuf…
thorax
  • 574
  • 1
  • 5
  • 16
2
votes
1 answer

Why is protobuf 5-10x slower than memcpy for a list of bytes?

I've got two simple code blocks that have vastly different performance: void testProto() { demo::Person* person = new demo::Person(); person->set_data(data, BUFFER_LEN); } void testMemcpy() { demo::Person* person = new demo::Person(); …
theicfire
  • 2,719
  • 2
  • 26
  • 29
2
votes
0 answers

Facing undefined reference error after upgrading Protobuf

I had upgraded the protoc version from 3.0.0 to 3.15.2 . Now I am unable to compile the program that uses protoc output files(*.pb.cpp , *.pb.h). I am getting the error as shown below: In function…
2
votes
0 answers

Unexpected Group Tag error while deserializing protobuf file

While deserializing onnx binary I am getting following error: Traceback (most recent call last): from model.ParseFromString(f.read()) File "~/protobuf-3.3.0-py2.7.egg/google/protobuf/message.py", line 185, in ParseFromString …
1 2
3
13 14