简体   繁体   中英

Error compiling grpc generated source

Im running into some issues compiling both the example route_guide generated source as well as my own. Im sure that its user error but Im not sure where the issue is. The error seems to hint something with GRPC_FINAL which I wasn't able to find a reference to.

$ protoc --version libprotoc 3.0.0

./route_guide.grpc.pb.h:29:2: error: expected expression
 public:
 ^
./route_guide.grpc.pb.h:28:18: error: variable has incomplete type 'class RouteGuide'
class RouteGuide GRPC_FINAL {
             ^
./route_guide.grpc.pb.h:28:7: note: forward declaration of   'routeguide::RouteGuide'
class RouteGuide GRPC_FINAL {
  ^
route_guide.grpc.pb.cc:25:18: error: incomplete type 'routeguide::RouteGuide' named in nested name specifier
std::unique_ptr< RouteGuide::Stub> RouteGuide::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
             ^~~~~~~~~~~~
./route_guide.grpc.pb.h:28:7: note: forward declaration of       'routeguide::RouteGuide'
    class RouteGuide GRPC_FINAL {

通过卸载所有grpc库和标头并从v1.0.x分支重建,我能够解决此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM