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
1
vote
1 answer

Converting protocol buffers to/from JSON in C, without generating C code

I need to use .desc files to enable the reading of serialized protocol-buffer messages and their conversion to JSON (using jansson). This is because the protocol-buffer message formats will change much more frequently than the C code. The .desc…
fadedbee
  • 42,671
  • 44
  • 178
  • 308
0
votes
1 answer

Why is my protobuf not working correctly with enum types?

This is the proto file: package net; message msgBase { optional string protoName = 1; optional SendType sendType = 2; //optional NetClient sendClient = 3; optional float roomID = 4; //optional NetClient tagClient = 5; } enum…
YueYuHai
  • 1
  • 4
0
votes
0 answers

Coverage parameters of the clang code coverage function change the code logic?

I have a section of the BUILD.gn file configured as follows: config("test") { cflags = [ "-std=c++17", "-fvisibility=hidden", ] cflags_cc = [ "-fvisibility-inlines-hidden" ] ldflags = [] if (enable_coverage) { # clang…
0
votes
0 answers

Build Error while installing ONNX in Linux

In order to install OnnX library for linux after cloning the repository. git clone --recursive https://github.com/Microsoft/onnxruntime Then ran the build.sh with the following configuration --skip-tests --parallel and --config as Release and also…
RAHUL ROY
  • 1
  • 2
0
votes
1 answer

Which versions of google-cloud-pubsub and mysql-connector-python are compatible?

I'm setting up a project that will utilize both a MySQL DB and Google PubSub and it will be hosted in GCP. I'm working on the dependencies and I ran into an error when installing both…
0
votes
0 answers

error: undefined reference to 'google::protobuf::ShutdownProtobufLibrary()

While building the protobuf and protobuf-c and clang. I'm facing some error. What my guess is I'm unable to link the protobuf while invoking the cmake for building clang despite me passing -L/usr/local/lib this flag. And my protobuf is installed in…
0
votes
0 answers

In Tensorflow, how to get the shape of all tensors in a graph with c++?

If the shapes of all tensors in a tensorflow graph are well defined, I want to be able to extract the shape of all tensors. The tensorflow graph is saved as a protobuf file. Here is an example of it being made: with tf.Graph().as_default() as…
0
votes
0 answers

Unable to run Constructing Repeated Submessages With Protobuf-c

I am trying to run the example file given in the Wiki, but I am not able to see the output that is shown in the wiki example. I copied the contents in the code blocks to files fmessage_serialize.c and fmessage_deserialize.c and fmessage.proto. I am…
0
votes
1 answer

How to parse com.google.cloud.retail.v2.Product object to JSON?

I am implementing Google Retail Search into the project. Google API require me to provide Product object in given JSON format. JSON representation of Product with minimum number of fields populated look like following: { "id": "1234", …
Makabeusz
  • 36
  • 2
0
votes
1 answer

Instantiate struct by name or ID in C

I know reflection is not possible in C, but I have a unique issue in an embedded environment that can only allocate memory at init time. We are using an embedded version of 0MQ and nanopb for communication between several microservices, where one…
Big Guy
  • 33
  • 6
0
votes
1 answer

Why does my_msg__get_packed_size() return 0 on empty message?

I am trying to use the protobuf-c library to send messages in between sockets in C. Steps to reproduce Create a .proto file with the messages: syntax = "proto3"; message MyMsg {} Compile it with protoc c_out=. rpc.proto I get my rpc.pb-c.h/c…
doplumi
  • 2,938
  • 4
  • 29
  • 45
0
votes
1 answer

SerializeAsString - server, ParseFromString - client. "Decode error" Exception occurred, but the data looks correct

Our application workflow uses protobuf for cross-language IPC. We have a C++ application publishing data over Linux shared memory to various clients on the same host. Data is published to shared memory using the protobuf API of "SerializeAsString",…
0
votes
0 answers

Is there a way to change a value while using an iterator when using c++ protobuf?

I want to modify the value of manifest.xml in c++. I use an iterator to find a specific value, but the value is not modified. Is there any way to change it? Below is the code I used. thank you. int main () { aapt::pb::XmlNode asdf; std::string…
Sta Worl
  • 9
  • 2
0
votes
1 answer

proto import file not found (project was managed by bazel), How can I set the import path correctly?

I use bazel to manage my project and I want to generate protobuf files by bazel build. Here is my file path tree: There are two problems: How to make geometry.proto import matrix.proto (in the same folder)? syntax = "proto2"; import…
0
votes
0 answers

If I could use SIMD process ProtoBuf RepeatedField data directly,or is there a way to parse RepeatedField to vector efficiently?

I use ProtoBuf RepeatedField store my 64 bit uint vector.Now I want to get the sum or product of two RepeatedField,and I want to use SIMD to accelerate the speed. If I could access the RepeatedField's memory,just like a vector,to finish…