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
2
votes
2 answers

how to remove auto generated proto files from generated folder

I have the below MSBuild to generate .cs files from my proto files. The build works fine until I do a rebuild where it complains of Source file 'generated-proto-output/Trade.cs# specified multiple times. How do I delete my .cs files before…
serah
  • 2,057
  • 7
  • 36
  • 56
2
votes
0 answers

Reference variable and initializer lists

I am using protobuf, and I was assigning a const reference to another reference, this seems to trigger the copy constructor if I use {}, but works fine if I use (). For example, // Protobuf Messages message Test { string x = 1; } message List…
Lonewolf
  • 497
  • 5
  • 13
2
votes
0 answers

how can I read and unpack a protobuf c packed message in server side(using sockets)

I,m totally new in protobuf-c I,m trying to create a socket connection and send protobuf packed message over the socket using c language I packed the message within client code and send it to the server.But the server failed to receive the packed…
Nanetta
  • 101
  • 13
2
votes
2 answers

Postgis ST_AsMVT() return missing libprotobuf-c on MacOSX High Sierra

I try to get MVT format from my geometry table with this query SELECT ST_AsMVT(q) FROM ( SELECT id_kelurahan, nama_kelurahan, ST_AsMVTGeom( feature, …
Edgar P.
  • 129
  • 1
  • 1
  • 7
2
votes
0 answers

Tensorflow C API segmentation fault

I used Keras to train a simple RNN with 2 layers of LSTM with dropout. I want to load the .pb graph in tensorflow C API and use it for later prediction, but I got segmentation fault. Later I found if I keep the network the same and only removing the…
Feng
  • 67
  • 1
  • 9
2
votes
0 answers

can't get correct chinese character from " google::protobuf::TextFormat::PrintToString "

I was use the protobuf to read and write config file. but I found the chinese character can't correctly write to the file. the encode code: zrd::Config cfg; zrd::Market *market = nullptr; market =…
2
votes
2 answers

How can optional fields that are not assigned values in protocbuf be allocated spaces

If I defined: message A { required int32 first = 1; optional int32 second = 2; } The size of space when set_second(0) then serializeToArray() is not same with that when set_second(14353355445) then serializeToArray() Are there ways to make them…
李鹏程
  • 81
  • 1
  • 4
1
vote
0 answers

cannot link against protobuf using c++ in linux

I am trying to just do a simple example for protobuf and I am having trouble linking. I haven't found anything worthwhile on here. For starters, I have a very barebones .proto file tempproj.proto package tempproj; message name { required…
basil
  • 690
  • 2
  • 11
  • 30
1
vote
1 answer

Google protobuf adds weird 0xff values when decoding bytes which are larger or equal to 0x80 from message

I have this message file: message samplemessage { optional bytes byte_string = 1; } And this program which uses this protobuf file: #include #include #include #include "mymessages.pb.h" using namespace std; //…
1
vote
1 answer

Linking warning in protobuf-c

The build script: if [ -f ${PWD_PATH}/succeed/protobuf-c ]; then echo "git clone https://github.com/protobuf-c/protobuf-c.git" eval "git clone https://github.com/protobuf-c/protobuf-c.git" eval 'cd protobuf-c && git checkout v1.4.0 &&…
NobinPegasus
  • 545
  • 2
  • 16
1
vote
1 answer

Cmake find_package(Protobuf REQUIRED) does not work out as I wanted

My goal is to configure cmake file and build my app with protobuf lib. My attempted steps: built protobuf in Ubuntu 20.04 followed this section of instruction from protobuf github repo C++ Protobuf - Unix, including copy protoc to…
Dan.Z.Lu
  • 67
  • 7
1
vote
0 answers

Repeated submessage fields always decodes to zero

I have a somewhat deeply nested .proto. Message is a union, Update is a member of that union (ignoring the others for the sake of this question), Update contains a repeated Config (added just once for simplicity), Config contains actual data (ints…
Indigo
  • 962
  • 1
  • 8
  • 23
1
vote
1 answer

Adding protobuf in yocto recipe

How can we add protobuf specific version (say : 3.19.6) in the yocto recipe? what are the things that we can add in the yocto recipe to install protobuf 3.19.6
1
vote
1 answer

google protobuf - how to access size of buffer as specified in .proto file?

My protobuf file is message Msg{ // User Authentication data as bytes. bytes MsgData = 1 [(nanopb).max_size = 2048]; } When I generate the C API, the relevant parts are: #define PB_BYTES_ARRAY_T(n) struct { pb_size_t size; pb_byte_t…
Bob
  • 4,576
  • 7
  • 39
  • 107
1
vote
0 answers

How to generate values for all fields including required fields in a protobuf message

I have a big protobuf message. I'd like to set all the fields of the message including optional and required fields. Is there any way to do it without using the set_field_name() for each field in the message
Rachel
  • 25
  • 7