protocol-buffers

Using google protobuf with libraries in cmake on Windows, Visual Studio 2013

一个人想着一个人 提交于 2020-08-08 06:38:50
问题 I have a CMake project with several sub-directories and library modules that eventually get built into client and server libraries, and those libraries are used from executable to test them. I am trying to use Google's protobuf library inside one of those libraries. I am creating my sub-library as follows: include_directories( . ../rendering_backend ../shared ${MY_THIRDPARTY_DIR}/protobuf/include ) add_library(Client STATIC client.cpp client.hpp ../common.hpp ../shared/protobufs/my_bufs.pb.cc

Relative import in Go for protobuf , cannot find module path

扶醉桌前 提交于 2020-07-31 06:05:36
问题 I'm trying to write a service in go with gRPC, and when i import the protobuff file , getting an error. i tried removing all the modules in my go path and reinitialising the go modules build _/Users/tibinlukose/cart-service/pb: cannot find module for path _/Users/tibinlukose/cart-service/pb Code package main import ( pbcart "../pb/" "log" "fmt" "google.golang.org/grpc" "net" ) var ( port = 1000; ) type CartServiceServer struct { } func main() { log.SetFlags(log.LstdFlags | log.Lshortfile) fmt

How to log Protobuf string in nested objects in a human-readable way?

不打扰是莪最后的温柔 提交于 2020-07-30 17:24:55
问题 Given a proto file: syntax = "proto3"; package hello; message TopGreeting { NestedGreeting greeting = 1; } message NestedGreeting { Greeting greeting = 1; } message Greeting { string message = 1; } and the code: public class Main { public static void main(String[] args) { System.out.printf("From top: %s%n", newGreeting("오늘은 무슨 요일입니까?")); System.out.printf("Directly: %s%n", "오늘은 무슨 요일입니까?"); System.out.printf("ByteString: %s", newGreeting("오늘은 무슨 요일입니까?").toByteString().toStringUtf8()); }

How to log Protobuf string in nested objects in a human-readable way?

荒凉一梦 提交于 2020-07-30 17:23:36
问题 Given a proto file: syntax = "proto3"; package hello; message TopGreeting { NestedGreeting greeting = 1; } message NestedGreeting { Greeting greeting = 1; } message Greeting { string message = 1; } and the code: public class Main { public static void main(String[] args) { System.out.printf("From top: %s%n", newGreeting("오늘은 무슨 요일입니까?")); System.out.printf("Directly: %s%n", "오늘은 무슨 요일입니까?"); System.out.printf("ByteString: %s", newGreeting("오늘은 무슨 요일입니까?").toByteString().toStringUtf8()); }

When I try to generate files for protobuf I get error ModuleNotFoundError

夙愿已清 提交于 2020-07-22 22:08:19
问题 When I try to generate files with the command python -m grpc_tools.protoc -I./ --python_out=. --grpc_python_out=. service.proto I get error. Traceback: test_client.py:11: in <module> from tests.remote.grpc_wrapper.service_pb2_grpc import TestServiceServicer, add_TestServiceServicer_to_server, \ service_pb2_grpc.py:4: in <module> import service_pb2 as service__pb2 E ModuleNotFoundError: No module named 'service_pb2' How can I fix it? I truing reinstall protobuf but it don’t help me. pip

compile protobuf client code on ubuntu, but include file is not found

浪子不回头ぞ 提交于 2020-07-21 11:39:33
问题 I just installed google protocol buffer on my ubuntu1604: sudo apt install protobuf-compiler And tried a quick test, 1 proto file, 1 cpp file to use it, try to see the encode/decode results: $ cat 1.proto package x; message my{ required string name=1; required int32 id=2; optional string email=3; } $ cat 1.cpp #include"1.pb.cc" #include<string> #include<iostream> using namespace std; using namespace x; int main() { my p; p.set_name("tom"); p.set_id(18); p.set_email("aa@bb.com"); string s; my

compile protobuf client code on ubuntu, but include file is not found

痴心易碎 提交于 2020-07-21 11:30:26
问题 I just installed google protocol buffer on my ubuntu1604: sudo apt install protobuf-compiler And tried a quick test, 1 proto file, 1 cpp file to use it, try to see the encode/decode results: $ cat 1.proto package x; message my{ required string name=1; required int32 id=2; optional string email=3; } $ cat 1.cpp #include"1.pb.cc" #include<string> #include<iostream> using namespace std; using namespace x; int main() { my p; p.set_name("tom"); p.set_id(18); p.set_email("aa@bb.com"); string s; my

How to solve “AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key”?

自闭症网瘾萝莉.ら 提交于 2020-07-18 09:19:45
问题 I encountered it while executing from object_detection.utils import label_map_util in jupyter notebook. It is actually the tensorflow object detection tutorial notebook(it comes with the tensorflow object detection api) The complete error log: AttributeError Traceback (most recent call last) <ipython-input-7-7035655b948a> in <module> 1 from object_detection.utils import ops as utils_ops ----> 2 from object_detection.utils import label_map_util 3 from object_detection.utils import

NanoMsg (NNG) & FlatBuffers the correct fit for this project?

社会主义新天地 提交于 2020-07-15 04:07:08
问题 Shout out if there is something better we should consider: I am looking for a very quick and simple way to get several programs (e.g. 5) - each running on separate nodes on a private OpenStack cloud to talk to each other. Packets will be short C++ structs (less than 100 bytes) Traffic will be light (probably less than 100/second) Latency is really not an issue. (what is a few ms between friends?) - we have lots of cycles and memory Messages should be done as pub/sub client/server paradigm

NanoMsg (NNG) & FlatBuffers the correct fit for this project?

谁都会走 提交于 2020-07-15 04:05:56
问题 Shout out if there is something better we should consider: I am looking for a very quick and simple way to get several programs (e.g. 5) - each running on separate nodes on a private OpenStack cloud to talk to each other. Packets will be short C++ structs (less than 100 bytes) Traffic will be light (probably less than 100/second) Latency is really not an issue. (what is a few ms between friends?) - we have lots of cycles and memory Messages should be done as pub/sub client/server paradigm