apache / apache/brpc

protobuf 3.7.1 编译最新brpc报错

Open
#2,578 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

```
[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::allocator > >*, char const*)':
/usr/local/include/google/protobuf/io/printer.h:300: undefined reference to `google::protobuf::io::Printer::Print(std::map, std::allocator > > const&, char const*)'
/usr/local/include/google/protobuf/io/printer.h:300: undefined reference to `google::protobuf::io::Printer::Print(std::map, std::allocator > > const&, char const*)'
/usr/local/include/google/protobuf/io/printer.h:300: undefined reference to `google::protobuf::io::Printer::Print(std::map, std::allocator > > const&, char const*)'
/usr/local/include/google/protobuf/io/printer.h:300: undefined reference to `google::protobuf::io::Printer::Print(std::map, std::allocator > > const&, char const*)'
/usr/local/include/google/protobuf/io/printer.h:300: undefined reference to `google::protobuf::io::Printer::Print(std::map, std::allocator > > 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::allocator > > 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 > 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,然后还是报错

Contributor guide

Open the contributing guide

Research direction

Start with the CMake target protoc-gen-mcpack and mcpack2pb/generator.cpp, then inspect the protobuf headers and libraries involved in the linker errors. Reproduce the build with protobuf 3.7.1 and the reported protobuf 2.5 setup, including generation of brpc/grpc_health_check.proto. Done means the project configures and make completes without the reported linker or proto-generation failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.