apache / apache/brpc

thrift支持时,编译出错

Open
#1,328 3 comments 0 reactions 0 assignees View on GitHub
bug good first issue
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

**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::TBinaryProtocolT(apache::thrift::protocol::TBinaryProtocolT&&)’
/usr/local/include/thrift/protocol/TBinaryProtocol.h:38:7: note: no known conversion for argument 1 from ‘boost::shared_ptr’ to ‘apache::thrift::protocol::TBinaryProtocolT&&’
/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::TBinaryProtocolT(boost::shared_ptr&)’
673 | apache::thrift::protocol::TBinaryProtocolT 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::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 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
Date: Thu Jan 7 19:25:17 2021 +0100

**Additional context/screenshots (更多上下文/截图)**

Contributor guide

Open the contributing guide

Research direction

Start with the WITH_THRIFT build command and inspect brpc/policy/thrift_protocol.cpp around line 673, then compare the TBinaryProtocolT constructors shown in the compiler output and /usr/local/include/thrift/protocol/TBinaryProtocol.h. Done means the project builds successfully with thrift enabled on the reported environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.