Category : protobuf-c

protofile syntax = "proto3"; service ConfiguratorDasService { rpc GetController(GetControllerReq) returns (GetControllerRes) {}; } message GetControllerReq { uint32 number = 1; } message GetControllerRes { string value = 1; bool done = 2; } cpp file CDeviceSh CConfiguration::GetController(uint32_t id) { GetControllerReq request; request.set_number(id); auto dump = request.SerializeAsString(); GetControllerRes reply; ClientContext context; Status status = m_stub->GetController(&context, request, ..

Read more

I have a problem when run this program. I have a thread that periodically actives this function: bool ControlComponent::Proc() { double start_timestamp = Clock::NowInSeconds(); std::cout << "Proc" << std::endl; if (!shm_pop(shm_localization_module, &latest_localization_)) { AERROR << "Localization msg is not ready!"; return false; } std::cout << "Localization msg ready!" << std::endl; if (!shm_pop(shm_planning_module, &latest_trajectory_)) { AERROR ..

Read more

Установил protobuf из исходников, все по инструкции,ошибок в процессе установки не возникало. Написал тестовый proto файл syntax = "proto3"; message Address{ string street = 1; uint32 building = 2; } message Person{ string name = 1; int32 age = 2; repeated string phone_numbers = 3; } Написал cmake cmake_minimum_required(VERSION 3.17) project(protobuf_test3) set(CMAKE_CXX_STANDARD 17) find_package(Protobuf REQUIRED) ..

Read more

I am trying to build c++ code that will use protobuf to serialize the data and send to pulsar message queue. I have written a protobuf protocol file and autogenerated a c++ code. I am building the code as this – /usr/bin/g++ -g –std=c++11 producer.cc protocol.pb.cc -o test ../protobuf-lib/lib/libprotobuf.so ../pulsar-lib/lib/libpulsar.so -I ../protobuf-lib/include/ -I ../pulsar-lib/include/ The ..

Read more

I’m trying to run the protoc command that will generate the .cpp/.h files for a project. however, when I run the command, I see this error message: > -I=test_game_server –cpp_out==dllexport_decl=MY_EXPORT_MACRO:test_game_server test_game_servergameinformation.proto –cpp_out: gameinformation.proto: Unknown generator option: I’d like to stress that this is the entire error message, the unknown option is just… blank. I’ve turned ..

Read more

I’m working on a C++ project in VS 2017 that uses a Protobuf type. This type is defined in an autogenerated library called gameinformation.pb.h. This header file defines the namespace GameInfo and the conatined class, GameInformation. I was experiencing some library issues before but I fixed them by adding the path to libprotobuf.lib in Linker ..

Read more