Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译报错,protoc版本问题 #2807

Open
FHBOL opened this issue Nov 1, 2024 · 1 comment
Open

编译报错,protoc版本问题 #2807

FHBOL opened this issue Nov 1, 2024 · 1 comment

Comments

@FHBOL
Copy link

FHBOL commented Nov 1, 2024

Describe the bug (描述bug)
编译报错,protoc版本不合适
按照文档,make后出现,可能是protoc版本的问题,但是文档中没有指明合适的版本,我的protoc版本应该是5.28.3,自己在另一台ubuntu22上也是出现同样的问题,另一台Ubuntu的protoc版本为3.20.3,我在两台电脑都出现了同样的问题,那感觉其他人在首次编译brpc大概率也会出现同样的问题,希望在文档中补全相关的解决方案
To Reproduce (复现方法)
/Users/fang/brpc/idl_options.pb.h:12:2: error: This file was generated by a newer version of protoc which is
#error This file was generated by a newer version of protoc which is
^
/Users/fang/brpc/idl_options.pb.h:13:2: error: incompatible with your Protocol Buffer headers. Please update
#error incompatible with your Protocol Buffer headers. Please update
^
/Users/fang/brpc/idl_options.pb.h:14:2: error: your headers.
#error your headers.
^
/Users/fang/brpc/idl_options.pb.h:36:1: error: unknown type name 'PROTOBUF_NAMESPACE_OPEN'
PROTOBUF_NAMESPACE_OPEN
^
/Users/fang/brpc/idl_options.pb.h:37:1: error: expected unqualified-id
namespace internal {
^
/Users/fang/brpc/idl_options.pb.h:40:1: error: unknown type name 'PROTOBUF_NAMESPACE_CLOSE'
PROTOBUF_NAMESPACE_CLOSE
^
/Users/fang/brpc/idl_options.pb.h:46:16: error: no member named 'PROTOBUF_NAMESPACE_ID' in the global namespace
extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_idl_5foptions_2eproto;
~~^
/Users/fang/brpc/idl_options.pb.h:47:1: error: unknown type name 'PROTOBUF_NAMESPACE_OPEN'
PROTOBUF_NAMESPACE_OPEN
^
/Users/fang/brpc/idl_options.pb.h:48:25: error: expected ';' after top level declarator
PROTOBUF_NAMESPACE_CLOSE

Expected behavior (期望行为)

Versions (各种版本)
OS:mac sequoia 15.0.1
Compiler: clang version 14.0.3
brpc: Commit e1bf467
protobuf:5.28.3

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

@wasphin
Copy link
Member

wasphin commented Nov 2, 2024

看着是使用了不同版本的 protobuf 进行混合编译,建议清理下生成的 pb 文件全新编译下试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants