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

protobuf 3.7.1 编译最新brpc报错 #2578

Open
missximon opened this issue Mar 22, 2024 · 2 comments
Open

protobuf 3.7.1 编译最新brpc报错 #2578

missximon opened this issue Mar 22, 2024 · 2 comments

Comments

@missximon
Copy link

missximon commented Mar 22, 2024

[root@937d9313ad58 buildTest]# make
Consolidate compiler generated dependencies of target PROTO_LIB
[ 11%] Built target PROTO_LIB
Consolidate compiler generated dependencies of target BUTIL_LIB
[ 44%] Built target BUTIL_LIB
Consolidate compiler generated dependencies of target SOURCES_LIB
[ 94%] Built target SOURCES_LIB
[ 94%] Built target brpc-static
Consolidate compiler generated dependencies of target protoc-gen-mcpack
[ 94%] Linking CXX executable ../output/bin/protoc-gen-mcpack
CMakeFiles/protoc-gen-mcpack.dir/mcpack2pb/generator.cpp.o: In function `google::protobuf::internal::StringTypeTraits::Get(int, google::protobuf::internal::ExtensionSet const&, std::string const&)':
/usr/local/include/google/protobuf/extension_set.h:1056: undefined reference to `google::protobuf::internal::ExtensionSet::GetString(int, std::string const&) const'
CMakeFiles/protoc-gen-mcpack.dir/mcpack2pb/generator.cpp.o: In function `google::protobuf::io::Printer::PrintInternal(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >*, char const*)':
/usr/local/include/google/protobuf/io/printer.h:300: undefined reference to `google::protobuf::io::Printer::Print(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, char const*)'
/usr/local/include/google/protobuf/io/printer.h:300: undefined reference to `google::protobuf::io::Printer::Print(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, char const*)'
/usr/local/include/google/protobuf/io/printer.h:300: undefined reference to `google::protobuf::io::Printer::Print(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, char const*)'
/usr/local/include/google/protobuf/io/printer.h:300: undefined reference to `google::protobuf::io::Printer::Print(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, char const*)'
/usr/local/include/google/protobuf/io/printer.h:300: undefined reference to `google::protobuf::io::Printer::Print(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, char const*)'
CMakeFiles/protoc-gen-mcpack.dir/mcpack2pb/generator.cpp.o:/usr/local/include/google/protobuf/io/printer.h:300: more undefined references to `google::protobuf::io::Printer::Print(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, char const*)' follow
CMakeFiles/protoc-gen-mcpack.dir/mcpack2pb/generator.cpp.o:(.data.rel.ro._ZTVN9mcpack2pb16McpackToProtobufE[_ZTVN9mcpack2pb16McpackToProtobufE]+0x28): undefined reference to `google::protobuf::compiler::CodeGenerator::GenerateAll(std::vector<google::protobuf::FileDescriptor const*, std::allocator<google::protobuf::FileDescriptor const*> > const&, std::string const&, google::protobuf::compiler::GeneratorContext*, std::string*) const'
collect2: error: ld returned 1 exit status
make[2]: *** [output/bin/protoc-gen-mcpack] Error 1
make[1]: *** [src/CMakeFiles/protoc-gen-mcpack.dir/all] Error 2
make: *** [all] Error 2

有知道解决办法的吗...使用pb2.5直接报错:

[root@b8c6e7132fc1 build]# make
[  0%] Generating brpc/grpc_health_check.pb.h, brpc/grpc_health_check.pb.cc
brpc/grpc_health_check.proto:38:51: Expected ")".
make[2]: *** [brpc/grpc_health_check.pb.h] Error 1
make[1]: *** [CMakeFiles/PROTO_LIB.dir/all] Error 2
make: *** [all] Error 2

发现需要升级到3+,就升级到了3.7.1,然后还是报错

@missximon
Copy link
Author

brpc version: commit id d4695c9

@wasphin
Copy link
Member

wasphin commented Mar 22, 2024

像是编译的 protobuf 和 brpc 的 _GLIBCXX_USE_CXX11_ABI 不一样导致的,可以统一下配置

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