protocol-buffers

Protobuf-net - serializing .NET GUID - how to read this in C++?

只谈情不闲聊 提交于 2019-12-02 13:38:12
问题 I have serialized an object using Protobuf-net , in my .NET application, with relative ease. I also get the .proto file that protobuf-net generated, using GetProto() command. In the .NET generated .proto file, my GUID fields get a type of "bcl.guid". Now I wish to compile the .proto file in C++ so I can deserialize the data. However, C++ protoc.exe compiler does not know how to interpret bcl.guid, and throws an error message "VideoAudioStructs.proto:11:13: "Guid" is not defined." What do I do

How do I Share Enum values between my Java code and .proto file

余生颓废 提交于 2019-12-02 12:15:25
I have a class that I wish to protobuf. in that class one of the fields is an enum (in a class of it's own). Can I avoid defining an identical enum value in my .proto file ? Or will I have to manually make sure the enum definition in the java code is the same as in the .proto file? java code: public enum Location { UNDEF(0),HOME(1), WORK(2); ... } .proto file corresponding code: message Address{ enum location { UNDEF = 0; HOME = 1; WORK = 2; } optional location addressLocation; ... } The best solution for keeping things like this in sync is often code generation; determine which of your

How to fix tensorflow protobuf compilation errors on OSX?

﹥>﹥吖頭↗ 提交于 2019-12-02 11:34:15
问题 I'm trying to compile TensorFlow after checking out the repo. I've reached a point where I'm stuck with google protobuf errors: INFO: From Compiling tensorflow/core/kernels/histogram_op_gpu.cu.cc: ./tensorflow/core/lib/core/status.h(32): warning: attribute "warn_unused_result" does not apply here external/protobuf_archive/src/google/protobuf/arena.h(719): error: more than one instance of overloaded function "google::protobuf::Arena::CreateMessageInternal" matches the argument list: function

Google protobuf and Android NDK

这一生的挚爱 提交于 2019-12-02 08:23:19
How to build Google protobuf (c++ version, https://github.com/google/protobuf/releases/latest ) with Android target? I compiled protobuf without ndk-build. Here's the script (not very clean but it works): rm -rf /tmp/protobuf-3.3.0/ tar xzvf ~/Downloads/protobuf-cpp-3.3.0.tar.gz -C /tmp/ cd /tmp/protobuf-3.3.0/ export NDK_ROOT=/home/user/SDKS/ANDROID/NDK/android-ndk-r13b export SYSROOT=$NDK_ROOT/platforms/android-9/arch-arm export PREBUILT=$NDK_ROOT/toolchains/arm-linux-androideabi-4.9 export LDFLAGS="--sysroot=$SYSROOT" export LD="$NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux

Getting segfault due to string data type variable in PROTOBUF server and client communication through sockets on recv end in cpp

青春壹個敷衍的年華 提交于 2019-12-02 08:19:37
When I am sending a protobuf variable through socket communication on recv end I am trying to display the string variable of protobuf I got segmentation in this remaining Data type other than String they are working fine but string variable case I got segmentation How can I over come in Protobuf string datatype segmentation fault other than we have any other data type for store the string data type. I create a example.proto with in string variable name is there I am compile example.proto with protoc compiler ( protoc example.proto --cpp_out <path> ) it create two files two files example.pb.h,

Program with protocol-buffers don't compile with MinGW-w64: “undefined reference to google::protobuf:: …”

倖福魔咒の 提交于 2019-12-02 08:03:55
I have installed the libprotobuf-dev=2.6.0-4 and protobuf-compiler=2.6.0-4 packages from Debian Jessie repository. Now I'm trying to compile a program that use the 'addressbook.proto' file from the Google Developers example with the MinGW-w64 compiler. I'm using Ubuntu 14.04. With this command the program works: $ g++ main.cpp addressbook.pb.cc -lprotobuf But I want to compile for Windows too. I added the symlink: /usr/include/google -> /usr/i686-w64-mingw32/include/google . $ i686-w64-mingw32-g++ main.cpp addressbook.pb.cc -lprotobuf /usr/bin/i686-w64-mingw32-ld: cannot find -lprotobuf

“Failed to parse input” from Google protocol buffers protoc command for ``--decode_raw``

心不动则不痛 提交于 2019-12-02 07:36:51
问题 I have a google protobuf file from OpenStreetMap, specifically I have the 1.4MB Liechtenstein country extract from Geofabrik. The protoc command says it "write the raw tag/values to stdout" with the --decode_raw option. However I keep getting this error: $ cat liechtenstein-latest.osm.pbf | protoc --decode_raw Failed to parse input. I have compiled and installed the protobuf library direct from Google, version 2.6.1 which is the current one. This file is valid, various OpenStreetMap tools

Use elephant-bird with hive to read protobuf data

半城伤御伤魂 提交于 2019-12-02 06:23:05
问题 I have a similar problem like this one The followning are what I used: CDH4.4 (hive 0.10) protobuf-java-.2.4.1.jar elephant-bird-hive-4.6-SNAPSHOT.jar elephant-bird-core-4.6-SNAPSHOT.jar elephant-bird-hadoop-compat-4.6-SNAPSHOT.jar The jar file which include the protoc compiled .class file. And I flow Protocol Buffer java tutorial create my data "testbook". And I use hdfs dfs -mkdir /protobuf_data to create HDFS folder. Use hdfs dfs -put testbook /protobuf_data to put "testbook" to HDFS. Then

How to fix tensorflow protobuf compilation errors on OSX?

杀马特。学长 韩版系。学妹 提交于 2019-12-02 06:19:56
I'm trying to compile TensorFlow after checking out the repo. I've reached a point where I'm stuck with google protobuf errors: INFO: From Compiling tensorflow/core/kernels/histogram_op_gpu.cu.cc: ./tensorflow/core/lib/core/status.h(32): warning: attribute "warn_unused_result" does not apply here external/protobuf_archive/src/google/protobuf/arena.h(719): error: more than one instance of overloaded function "google::protobuf::Arena::CreateMessageInternal" matches the argument list: function template "T *google::protobuf::Arena::CreateMessageInternal<T>(google::protobuf::Arena *)" function

“Failed to parse input” from Google protocol buffers protoc command for ``--decode_raw``

假装没事ソ 提交于 2019-12-02 06:06:41
I have a google protobuf file from OpenStreetMap , specifically I have the 1.4MB Liechtenstein country extract from Geofabrik . The protoc command says it "write the raw tag/values to stdout" with the --decode_raw option. However I keep getting this error: $ cat liechtenstein-latest.osm.pbf | protoc --decode_raw Failed to parse input. I have compiled and installed the protobuf library direct from Google, version 2.6.1 which is the current one. This file is valid, various OpenStreetMap tools that read pbf files ( osm2pgsql , osmosis ) can read it fine. What could be wrong? How can I get -