You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2021/01/10 03:41:44 UTC

[GitHub] [incubator-brpc] southbear-club opened a new issue #1328: thrift支持时,编译出错

southbear-club opened a new issue #1328:
URL: https://github.com/apache/incubator-brpc/issues/1328


   **Describe the bug (描述bug)**
   开启thrift,cmake -B build -DWITH_THRIFT=ON编译出错
   
   /usr/local/include/thrift/protocol/TBinaryProtocol.h:38:7: note: candidate: ‘apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer>::TBinaryProtocolT(apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer>&&)’
   /usr/local/include/thrift/protocol/TBinaryProtocol.h:38:7: note:   no known conversion for argument 1 from ‘boost::shared_ptr<apache::thrift::transport::TMemoryBuffer>’ to ‘apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer>&&’
   /mnt/e/ormosiaVM/github/Asty/Asty-platform-server/thirdparty/incubator-brpc/src/brpc/policy/thrift_protocol.cpp: In function ‘void brpc::policy::SerializeThriftRequest(butil::IOBuf*, brpc::Controller*, const google::protobuf::Message*)’:
   /mnt/e/ormosiaVM/github/Asty/Asty-platform-server/thirdparty/incubator-brpc/src/brpc/policy/thrift_protocol.cpp:673:110
    error: no matching function for call to ‘apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer>::TBinaryProtocolT(boost::shared_ptr<apache::thrift::transport::TMemoryBuffer>&)’
     673 |         apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer> oprot(out_buffer);
         |                                                                                                              ^
   In file included from /mnt/e/ormosiaVM/github/Asty/Asty-platform-server/thirdparty/incubator-brpc/src/brpc/policy/thrift_protocol.cpp:39:
   /usr/local/include/thrift/protocol/TBinaryProtocol.h:52:3: note: candidate: ‘apache::thrift::protocol::TBinaryProtocolT<Transport_, ByteOrder_>::TBinaryProtocolT(std::shared_ptr<_Tp>, int32_t, int32_t, bool, bool) [with Transport_ = apache::thrift::transport::TMemoryBuffer; ByteOrder_ = apache::thrift::protocol::TNetworkBigEndian; int32_t = int]’
      52 |   TBinaryProtocolT(std::shared_ptr<Transport_> trans,
         |   ^~~~~~~~~~~~~~~~
   /usr/local/include/thrift/protocol/TBinaryProtocol.h:52:3: note:   candidate expects 5 arguments, 1 provided
   
   **To Reproduce (复现方法)**
   开启thrift,cmake -B build -DWITH_THRIFT=ON编译出错
   
   **Expected behavior (期望行为)**
   
   
   **Versions (各种版本)**
   OS:WSL2 ubuntu20.04
   Compiler:gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
   brpc:
   commit b226c34b019223d6f59dbde892ad59f6740a2439 (HEAD -> master, origin/master, origin/HEAD)
   Merge: b34b776c ba5d932d
   Author: Jiashun Zhu <zh...@gmail.com>
   Date:   Thu Jan 7 19:25:17 2021 +0100
   
   **Additional context/screenshots (更多上下文/截图)**
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] nephen commented on issue #1328: thrift支持时,编译出错

Posted by GitBox <gi...@apache.org>.
nephen commented on issue #1328:
URL: https://github.com/apache/incubator-brpc/issues/1328#issuecomment-953488234


   src/brpc/policy/thrift_protocol.cpp: 在函数‘bool brpc::policy::ReadThriftStruct(const butil::IOBuf&, brpc::ThriftMessageBase*, int16_t)’中:
   src/brpc/policy/thrift_protocol.cpp:133:105: 错误:对‘apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer>::TBinaryProtocolT(boost::shared_ptr<apache::thrift::transport::TMemoryBuffer>&)’的调用没有匹配的函数
        apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer> iprot(in_buffer);
                                                                                                            ^
   src/brpc/policy/thrift_protocol.cpp:133:105: 附注:备选是:
   In file included from src/brpc/policy/thrift_protocol.cpp:39:0:
   /usr/local/include/thrift/protocol/TBinaryProtocol.h:52:3: 附注:apache::thrift::protocol::TBinaryProtocolT<Transport_, ByteOrder_>::TBinaryProtocolT(std::shared_ptr<_Tp1>, int32_t, int32_t, bool, bool) [with Transport_ = apache::thrift::transport::TMemoryBuffer; ByteOrder_ = apache::thrift::protocol::TNetworkBigEndian; int32_t = int]
      TBinaryProtocolT(std::shared_ptr<Transport_> trans,
      ^
   /usr/local/include/thrift/protocol/TBinaryProtocol.h:52:3: 附注: 备选需要 5 实参,但提供了 1 个
   /usr/local/include/thrift/protocol/TBinaryProtocol.h:44:3: 附注:apache::thrift::protocol::TBinaryProtocolT<Transport_, ByteOrder_>::TBinaryProtocolT(std::shared_ptr<_Tp1>) [with Transport_ = apache::thrift::transport::TMemoryBuffer; ByteOrder_ = apache::thrift::protocol::TNetworkBigEndian]
      TBinaryProtocolT(std::shared_ptr<Transport_> trans)
      ^
   /usr/local/include/thrift/protocol/TBinaryProtocol.h:44:3: 附注:  no known conversion for argument 1 from ‘boost::shared_ptr<apache::thrift::transport::TMemoryBuffer>’ to ‘std::shared_ptr<apache::thrift::transport::TMemoryBuffer>’
   /usr/local/include/thrift/protocol/TBinaryProtocol.h:38:7: 附注:apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer>::TBinaryProtocolT(const apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer>&)
    class TBinaryProtocolT : public TVirtualProtocol<TBinaryProtocolT<Transport_, ByteOrder_> > {
          ^
   /usr/local/include/thrift/protocol/TBinaryProtocol.h:38:7: 附注:  no known conversion for argument 1 from ‘boost::shared_ptr<apache::thrift::transport::TMemoryBuffer>’ to ‘const apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer>&’
   /usr/local/include/thrift/protocol/TBinaryProtocol.h:38:7: 附注:apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer>::TBinaryProtocolT(apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer>&&)
   /usr/local/include/thrift/protocol/TBinaryProtocol.h:38:7: 附注:  no known conversion for argument 1 from ‘boost::shared_ptr<apache::thrift::transport::TMemoryBuffer>’ to ‘apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer>&&’
   src/brpc/policy/thrift_protocol.cpp: 在函数‘void brpc::policy::ReadThriftException(const butil::IOBuf&, apache::thrift::TApplicationException*)’中:
   src/brpc/policy/thrift_protocol.cpp:176:105: 错误:对‘apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer>::TBinaryProtocolT(boost::shared_ptr<apache::thrift::transport::TMemoryBuffer>&)’的调用没有匹配的函数
        apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TMemoryBuffer> iprot(in_buffer);
                                                                                                            ^
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] hcoona commented on issue #1328: thrift支持时,编译出错

Posted by GitBox <gi...@apache.org>.
hcoona commented on issue #1328:
URL: https://github.com/apache/incubator-brpc/issues/1328#issuecomment-983318183


   我最近发现一个 brpc 和 thrift 版本相关的问题。如果和 thrift v0.13.0 及更高版本一起联合编译,需要给 cxxopts 加参数 "-DTHRIFT_STDCXX=std",因为 thrift 后面删掉了 `apache::thrift::stdcxx`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] curoky commented on issue #1328: thrift支持时,编译出错

Posted by GitBox <gi...@apache.org>.
curoky commented on issue #1328:
URL: https://github.com/apache/incubator-brpc/issues/1328#issuecomment-1002430369


   去年6月份也遇到过,当时直接粗暴的改了下 brpc 的代码 https://github.com/apache/incubator-brpc/pull/1121/files


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org