apache / apache/brpc

brpc 使用arena分配pb内存编译错误

Open
#1,851 1 comment 0 reactions 0 assignees View on GitHub
kind/compile usage
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

**Describe the bug (描述bug)**
incubator-brpc-1.1.0.tar.gz / protobuf-3.19.2.tar.gz / thrift-0.16.0.tar.gz

**To Reproduce (复现方法)**
构建brpc
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: ../deps/incubator-brpc/lib/libbrpc.a(list_service.o): in function `google::protobuf::internal::GenericTypeHandler::New(google::protobuf::Arena*)':
/usr/local/include/google/protobuf/repeated_ptr_field.h:413: undefined reference to `google::protobuf::ServiceDescriptorProto* google::protobuf::Arena::CreateMaybeMessage(google::protobuf::Arena*)'
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: ../deps/incubator-brpc/lib/libbrpc.a(builtin_service.pb.o): in function `google::protobuf::internal::GenericTypeHandler::New(google::protobuf::Arena*)':
/usr/local/include/google/protobuf/repeated_ptr_field.h:413: undefined reference to `google::protobuf::ServiceDescriptorProto* google::protobuf::Arena::CreateMaybeMessage(google::protobuf::Arena*)'
/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/ld: /usr/local/include/google/protobuf/repeated_ptr_field.h:413: undefined reference to `google::protobuf::ServiceDescriptorProto* google::protobuf::Arena::CreateMaybeMessage(google::protobuf::Arena*)'
collect2: error: ld returned 1 exit status

**Expected behavior (期望行为)**
/usr/local/include/google/protobuf/arena.h 这个文件里面是有CreateMaybeMessage 的

**Versions (各种版本)**
OS: LInux 5.4.42-200.el7.x86_64
Compiler: g++11
brpc:
protobuf:

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

Contributor guide

Open the contributing guide

Research direction

Reproduce the brpc build with the listed brpc, protobuf, and thrift archives and inspect the linker error at repeated_ptr_field.h:413. Compare the referenced CreateMaybeMessage declaration in protobuf/arena.h with the linked protobuf artifacts and build configuration. Done means the brpc build links successfully without the undefined reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.