hongbshi opened a new issue #905: centos 7.6 静态链接失败
URL: https://github.com/apache/incubator-brpc/issues/905
 
 
   **Describe the bug (描述bug)**
   brpc依赖的gflags, leveldb, protobuf都已经重新编译, 生成了静态链接库。编译brpc已经成功, 
生成了libbrpc.a以及libbrpc.so。在应用程序中使用libbrpc.so可以成功编译, 使用libbrpc.a失败
   
   ../third_lib/libbrpc.a(span.cpp.o): In function `brpc::SpanDB::Open()':
   span.cpp:(.text+0x1d3c): undefined reference to `leveldb::Options::Options()'
   span.cpp:(.text+0x1e39): undefined reference to 
`leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
   span.cpp:(.text+0x1e6e): undefined reference to 
`leveldb::Status::CopyState(char const*)'
   span.cpp:(.text+0x1edf): undefined reference to `leveldb::Status::ToString() 
const'
   span.cpp:(.text+0x2046): undefined reference to 
`leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
   span.cpp:(.text+0x207f): undefined reference to 
`leveldb::Status::CopyState(char const*)'
   span.cpp:(.text+0x20eb): undefined reference to `leveldb::Status::ToString() 
const'
   ../third_lib/libbrpc.a(span.cpp.o): In function 
`brpc::SpanDB::Index(brpc::Span const*, std::string*)':
   span.cpp:(.text+0x365b): undefined reference to 
`leveldb::Status::CopyState(char const*)'
   span.cpp:(.text+0x3680): undefined reference to 
`leveldb::Status::CopyState(char const*)'
   span.cpp:(.text+0x36f9): undefined reference to 
`leveldb::Status::Status(leveldb::Status::Code, leveldb::Slice const&, 
leveldb::Slice const&)'
   span.cpp:(.text+0x3908): undefined reference to 
`leveldb::Status::Status(leveldb::Status::Code, leveldb::Slice const&, 
leveldb::Slice const&)'
   span.cpp:(.text+0x396f): undefined reference to 
`leveldb::Status::CopyState(char const*)'
   span.cpp:(.text+0x3990): undefined reference to 
`leveldb::Status::CopyState(char const*)'
   ../third_lib/libbrpc.a(span.cpp.o): In function 
`brpc::SpanDB::RemoveSpansBefore(long)':
   span.cpp:(.text+0x3c69): undefined reference to 
`leveldb::Status::CopyState(char const*)'
   span.cpp:(.text+0x3cd1): undefined reference to 
`leveldb::Status::CopyState(char const*)'
   span.cpp:(.text+0x3e35): undefined reference to 
`leveldb::Status::Status(leveldb::Status::Code, leveldb::Slice const&, 
leveldb::Slice const&)'
   span.cpp:(.text+0x3e54): undefined reference to 
`leveldb::Status::CopyState(char const*)'
   ../third_lib/libbrpc.a(span.cpp.o): In function 
`brpc::Span::dump_and_destroy(unsigned long)':
   span.cpp:(.text+0x4198): undefined reference to `leveldb::Status::ToString() 
const'
   span.cpp:(.text+0x42a7): undefined reference to `leveldb::Status::ToString() 
const'
   ../third_lib/libbrpc.a(gzip_compress.cpp.o): In function 
`brpc::policy::GzipCompress(google::protobuf::Message const&, butil::IOBuf*)':
   gzip_compress.cpp:(.text+0x26f): undefined reference to 
`google::protobuf::io::GzipOutputStream::Options::Options()'
   gzip_compress.cpp:(.text+0x28e): undefined reference to 
`google::protobuf::io::GzipOutputStream::GzipOutputStream(google::protobuf::io::ZeroCopyOutputStream*,
 google::protobuf::io::GzipOutputStream::Options const&)'
   gzip_compress.cpp:(.text+0x2b0): undefined reference to 
`google::protobuf::io::GzipOutputStream::~GzipOutputStream()'
   gzip_compress.cpp:(.text+0x2d1): undefined reference to 
`google::protobuf::io::GzipOutputStream::Close()'
   gzip_compress.cpp:(.text+0x2f4): undefined reference to 
`google::protobuf::io::GzipOutputStream::~GzipOutputStream()'
   ../third_lib/libbrpc.a(gzip_compress.cpp.o): In function 
`brpc::policy::ZlibCompress(google::protobuf::Message const&, butil::IOBuf*)':
   gzip_compress.cpp:(.text+0x32f): undefined reference to 
`google::protobuf::io::GzipOutputStream::Options::Options()'
   gzip_compress.cpp:(.text+0x34e): undefined reference to 
`google::protobuf::io::GzipOutputStream::GzipOutputStream(google::protobuf::io::ZeroCopyOutputStream*,
 google::protobuf::io::GzipOutputStream::Options const&)'
   gzip_compress.cpp:(.text+0x365): undefined reference to 
`google::protobuf::io::GzipOutputStream::Close()'
   gzip_compress.cpp:(.text+0x370): undefined reference to 
`google::protobuf::io::GzipOutputStream::~GzipOutputStream()'
   gzip_compress.cpp:(.text+0x39f): undefined reference to 
`google::protobuf::io::GzipOutputStream::~GzipOutputStream()'
   ../third_lib/libbrpc.a(gzip_compress.cpp.o): In function 
`brpc::policy::GzipDecompress(butil::IOBuf const&, google::protobuf::Message*)':
   gzip_compress.cpp:(.text+0x3fd): undefined reference to 
`google::protobuf::io::GzipInputStream::GzipInputStream(google::protobuf::io::ZeroCopyInputStream*,
 google::protobuf::io::GzipInputStream::Format, int)'
   gzip_compress.cpp:(.text+0x41f): undefined reference to 
`google::protobuf::io::GzipInputStream::~GzipInputStream()'
   gzip_compress.cpp:(.text+0x47a): undefined reference to 
`google::protobuf::io::GzipInputStream::~GzipInputStream()'
   ../third_lib/libbrpc.a(gzip_compress.cpp.o): In function 
`brpc::policy::ZlibDecompress(butil::IOBuf const&, google::protobuf::Message*)':
   gzip_compress.cpp:(.text+0x4cd): undefined reference to 
`google::protobuf::io::GzipInputStream::GzipInputStream(google::protobuf::io::ZeroCopyInputStream*,
 google::protobuf::io::GzipInputStream::Format, int)'
   gzip_compress.cpp:(.text+0x4e6): undefined reference to 
`google::protobuf::io::GzipInputStream::~GzipInputStream()'
   gzip_compress.cpp:(.text+0x544): undefined reference to 
`google::protobuf::io::GzipInputStream::~GzipInputStream()'
   ../third_lib/libbrpc.a(gzip_compress.cpp.o): In function 
`brpc::policy::GzipCompress(butil::IOBuf const&, butil::IOBuf*, 
google::protobuf::io::GzipOutputStream::Options const*)':
   gzip_compress.cpp:(.text+0x58f): undefined reference to 
`google::protobuf::io::GzipOutputStream::Options::Options()'
   gzip_compress.cpp:(.text+0x5c2): undefined reference to 
`google::protobuf::io::GzipOutputStream::GzipOutputStream(google::protobuf::io::ZeroCopyOutputStream*,
 google::protobuf::io::GzipOutputStream::Options const&)'
   gzip_compress.cpp:(.text+0x6af): undefined reference to 
`google::protobuf::io::GzipOutputStream::Next(void**, int*)'
   gzip_compress.cpp:(.text+0x6ea): undefined reference to 
`google::protobuf::io::GzipOutputStream::~GzipOutputStream()'
   gzip_compress.cpp:(.text+0x774): undefined reference to 
`google::protobuf::io::GzipOutputStream::Close()'
   gzip_compress.cpp:(.text+0x784): undefined reference to 
`google::protobuf::io::GzipOutputStream::BackUp(int)'
   gzip_compress.cpp:(.text+0x7d5): undefined reference to 
`google::protobuf::io::GzipOutputStream::~GzipOutputStream()'
   ../third_lib/libbrpc.a(gzip_compress.cpp.o): In function 
`brpc::policy::GzipDecompressBase(butil::IOBuf const&, butil::IOBuf*, 
google::protobuf::io::GzipInputStream::Format)':
   
gzip_compress.cpp:(.text._ZN4brpc6policy18GzipDecompressBaseERKN5butil5IOBufEPS2_N6google8protobuf2io15GzipInputStream6FormatE[_ZN4brpc6policy18GzipDecompressBaseERKN5butil5IOBufEPS2_N6google8protobuf2io15GzipInputStream6FormatE]+0x53):
 undefined reference to 
`google::protobuf::io::GzipInputStream::GzipInputStream(google::protobuf::io::ZeroCopyInputStream*,
 google::protobuf::io::GzipInputStream::Format, int)'
   
gzip_compress.cpp:(.text._ZN4brpc6policy18GzipDecompressBaseERKN5butil5IOBufEPS2_N6google8protobuf2io15GzipInputStream6FormatE[_ZN4brpc6policy18GzipDecompressBaseERKN5butil5IOBufEPS2_N6google8protobuf2io15GzipInputStream6FormatE]+0x168):
 undefined reference to 
`google::protobuf::io::GzipInputStream::~GzipInputStream()'
   
gzip_compress.cpp:(.text._ZN4brpc6policy18GzipDecompressBaseERKN5butil5IOBufEPS2_N6google8protobuf2io15GzipInputStream6FormatE[_ZN4brpc6policy18GzipDecompressBaseERKN5butil5IOBufEPS2_N6google8protobuf2io15GzipInputStream6FormatE]+0x1b2):
 undefined reference to `google::protobuf::io::GzipInputStream::Next(void 
const**, int*)'
   
gzip_compress.cpp:(.text._ZN4brpc6policy18GzipDecompressBaseERKN5butil5IOBufEPS2_N6google8protobuf2io15GzipInputStream6FormatE[_ZN4brpc6policy18GzipDecompressBaseERKN5butil5IOBufEPS2_N6google8protobuf2io15GzipInputStream6FormatE]+0x20a):
 undefined reference to `google::protobuf::io::GzipInputStream::Next(void 
const**, int*)'
   
gzip_compress.cpp:(.text._ZN4brpc6policy18GzipDecompressBaseERKN5butil5IOBufEPS2_N6google8protobuf2io15GzipInputStream6FormatE[_ZN4brpc6policy18GzipDecompressBaseERKN5butil5IOBufEPS2_N6google8protobuf2io15GzipInputStream6FormatE]+0x257):
 undefined reference to 
`google::protobuf::io::GzipInputStream::~GzipInputStream()'
   
   **Expected behavior (期望行为)**
   成功
   
   **Versions (各种版本)**
   OS: centos 7.6
   Compiler: gcc, g++ 4.8.5
   brpc: 最新release
   protobuf: 2.5.0
   
   **Additional context/screenshots (更多上下文/截图)**
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to