i write a simple client/server use grpc in c++. i want to use the server reflection.the server has work normally。i use bloomrpc to check the server reflection and it is ok. but i meet a problem in my own client.
#include <grpcpp/grpcpp.h>
int main(int argc,char **argv)
{
std::shared_ptr<grpc::Channel> channel = grpc::CreateChannel("localhost::50051", grpc::InsecureChannelCredentials());
grpc::ProtoReflectionDescriptorDatabase reflection_db(channel);
return 0;
}
it mention that namespace grpc don't have member ProtoReflectionDescriptorDatabase.
why is that?
i refer to this document https://grpc.github.io/grpc/core/md_doc_server_reflection_tutorial.html.
and the client code is also from this document.
the CMakeLists.txt is as follows:
cmake_minimum_required(VERSION 3.0)
project(testclient)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
SET(CMAKE_BUILD_TYPE "Debug")
set(SRC_LIST main.cpp)
find_package(Threads REQUIRED)
find_package(protobuf CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)
add_executable(testclient ${SRC_LIST} )
target_link_libraries(testclient gRPC::grpc++ gRPC::grpc++_reflection)