baidu / braft

An industrial-grade C++ implementation of RAFT consensus algorithm based on brpc, widely used inside Baidu to build highly-available distributed systems.
Apache License 2.0
3.98k stars 886 forks source link

已成功运行brpc示例,braft编译时cmake和make遇到undefined reference问题 #251

Open yusenfei opened 3 years ago

yusenfei commented 3 years ago

CentOS 7.2 GCC 4.8.5 /home/fys/Desktop

.
├── braft
│   ├── bld
│   ├── CMakeLists.txt
│    ……
└── incubator-brpc
    ├── build
    ├── CMakeLists.txt
    ├── example
    ├── src
     ……

成功编译incubator-brpc,并能运行incubator-brpc/example/里面的demo"echo" incubator-brpc全部按照默认配置,即:

If you need to enable cpu/heap profilers in examples:

sudo yum install gperftools-devel
If you need to run tests, install and compile gtest-devel (which is not compiled yet):

sudo yum install gtest-devel
To help VSCode or Emacs(LSP) to understand code correctly, add -DCMAKE_EXPORT_COMPILE_COMMANDS=ON to generate compile_commands.json

To change compiler to clang, overwrite environment variable CC and CXX to clang and clang++ respectively.

To not link debugging symbols, remove build/CMakeCache.txt and cmake with -DWITH_DEBUG_SYMBOLS=OFF

To use brpc with glog, cmake with -DWITH_GLOG=ON.

To enable thrift support, install thrift first and cmake with -DWITH_THRIFT=ON.

Examples link brpc statically, if you need to link the shared version, remove CMakeCache.txt and cmake with -DLINK_SO=ON

以上这几个按默认配置都没打开


然后我在braft/bld/目录下

$  cmake ..

提示:

-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found Protobuf: /usr/lib64/libprotobuf.so;-lpthread (found version "2.5.0") 
CMake Error at CMakeLists.txt:74 (message):
  Fail to find brpc  

然后我将braft/CMakeLists.txt中的

find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
find_library(BRPC_LIB NAMES libbrpc.a brpc)

修改为

set(BRPC_INCLUDE_PATH "/home/fys/Desktop/incubator-brpc/output/include")
set(BRPC_LIB "/home/fys/Desktop/incubator-brpc/output/lib")
#find_path(BRPC_INCLUDE_PATH NAMES brpc/server.h)
#find_library(BRPC_LIB NAMES libbrpc.a brpc)

并重新cmake,提示:

WARNING: Target "braft-shared" requests linking to directory "/home/fys/Desktop/incubator-brpc/output/lib".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "braft-static" requests linking to directory "/home/fys/Desktop/incubator-brpc/output/lib".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "braft_cli" requests linking to directory "/home/fys/Desktop/incubator-brpc/output/lib".  Targets may link only to libraries.  CMake is dropping the item.
-- Generating done
-- Build files have been written to: /home/fys/Desktop/braft/bld  

然后

$ make
[24%]Building CXX object src/CMakeFiles/OBJ_LIB.dir/braft/file_system_adaptor.cpp.o
/home/fys/Desktop/braft/src/braft/file_system_adaptor.cpp: In member function ‘virtual ssize_t braft::BufferedSequentialWriteFileAdaptor::write(const butil::IOBuf&, off_t)’:
/home/fys/Desktop/braft/src/braft/file_system_adaptor.cpp:125:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (offset < _buffer_offset + _buffer_size) {
                                   ^
/home/fys/Desktop/braft/src/braft/file_system_adaptor.cpp:133:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     } else if (offset > _buffer_offset + _buffer_size) {
                                          ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-reserved-user-defined-literal" [enabled by default]
[66%] Building CXX object src/CMakeFiles/OBJ_LIB.dir/braft/snapshot_executor.cpp.o
/home/fys/Desktop/braft/src/braft/snapshot_executor.cpp: In member function ‘void braft::SnapshotExecutor::do_snapshot(braft::Closure*)’:
/home/fys/Desktop/braft/src/braft/snapshot_executor.cpp:117:13: warning: unused variable ‘saved_last_snapshot_term’ [-Wunused-variable]
     int64_t saved_last_snapshot_term = _last_snapshot_term;
             ^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-reserved-user-defined-literal" [enabled by default]
[91%] Built target OBJ_LIB
Scanning dependencies of target braft-shared
[ 93%] Linking CXX shared library ../output/lib/libbraft.so
[ 93%] Built target braft-shared
Scanning dependencies of target braft-static
[ 95%] Linking CXX static library ../output/lib/libbraft.a
[ 95%] Built target braft-static
Scanning dependencies of target braft_cli
[ 97%] Building CXX object tools/CMakeFiles/braft_cli.dir/braft_cli.cpp.o
[100%]Linking CXX executable ../output/bin/braft_cli
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::snapshot()':
/home/fys/Desktop/braft/tools/braft_cli.cpp:153: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:142: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:141: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:141: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:145: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:142: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:153: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `operator<<':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:152: undefined reference to `butil::operator<<(std::ostream&, butil::BasicStringPiece<std::string> const&)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::snapshot()':
/home/fys/Desktop/braft/tools/braft_cli.cpp:153: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:145: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:145: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:142: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:153: undefined reference to `logging::LogMessage::~LogMessage()'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::add_peer()':
/home/fys/Desktop/braft/tools/braft_cli.cpp:59: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:43: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:41: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:41: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:43: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:42: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:42: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:46: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:43: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:59: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `operator<<':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:152: undefined reference to `butil::operator<<(std::ostream&, butil::BasicStringPiece<std::string> const&)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::add_peer()':
/home/fys/Desktop/braft/tools/braft_cli.cpp:59: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:46: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:46: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:51: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:51: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:42: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:51: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:59: undefined reference to `logging::LogMessage::~LogMessage()'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::remove_peer()':
/home/fys/Desktop/braft/tools/braft_cli.cpp:84: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:68: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:66: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:66: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:68: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:67: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:67: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:71: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:68: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:84: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `operator<<':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:152: undefined reference to `butil::operator<<(std::ostream&, butil::BasicStringPiece<std::string> const&)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::remove_peer()':
/home/fys/Desktop/braft/tools/braft_cli.cpp:84: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:71: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:71: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:76: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:76: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:67: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:76: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:84: undefined reference to `logging::LogMessage::~LogMessage()'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::change_peers()':
/home/fys/Desktop/braft/tools/braft_cli.cpp:101: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:93: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:91: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:91: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:93: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:92: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:92: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:96: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:93: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:109: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:101: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:101: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:109: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `operator<<':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:152: undefined reference to `butil::operator<<(std::ostream&, butil::BasicStringPiece<std::string> const&)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::change_peers()':
/home/fys/Desktop/braft/tools/braft_cli.cpp:109: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:96: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:96: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:92: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:101: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:109: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:96: undefined reference to `logging::LogMessage::~LogMessage()'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::reset_peer()':
/home/fys/Desktop/braft/tools/braft_cli.cpp:134: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:118: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:116: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:116: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:118: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:117: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:117: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:121: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:118: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:134: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `operator<<':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:152: undefined reference to `butil::operator<<(std::ostream&, butil::BasicStringPiece<std::string> const&)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::reset_peer()':
/home/fys/Desktop/braft/tools/braft_cli.cpp:134: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:121: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:121: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:126: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:126: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:117: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:126: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:134: undefined reference to `logging::LogMessage::~LogMessage()'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::transfer_leader()':
/home/fys/Desktop/braft/tools/braft_cli.cpp:178: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:162: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:160: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:160: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:162: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:161: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:161: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:165: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:162: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:178: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `operator<<':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:152: undefined reference to `butil::operator<<(std::ostream&, butil::BasicStringPiece<std::string> const&)'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::transfer_leader()':
/home/fys/Desktop/braft/tools/braft_cli.cpp:178: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:165: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:165: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:170: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:170: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:161: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:170: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:178: undefined reference to `logging::LogMessage::~LogMessage()'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `braft::cli::run_command(std::string const&)':
/home/fys/Desktop/braft/tools/braft_cli.cpp:203: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:203: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/tools/braft_cli.cpp:203: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/tools/braft_cli.cpp:203: undefined reference to `logging::LogMessage::~LogMessage()'
CMakeFiles/braft_cli.dir/braft_cli.cpp.o: In function `main':
/home/fys/Desktop/braft/tools/braft_cli.cpp:231: undefined reference to `butil::string_printf(std::string*, char const*, ...)'
../output/lib/libbraft.a(configuration.cpp.o): In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
../output/lib/libbraft.a(configuration.cpp.o): In function `braft::Configuration::parse_from(butil::BasicStringPiece<std::string>)':
/home/fys/Desktop/braft/src/braft/configuration.cpp:43: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/src/braft/configuration.cpp:43: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/src/braft/configuration.cpp:43: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/src/braft/configuration.cpp:43: undefined reference to `logging::LogMessage::~LogMessage()'
../output/lib/libbraft.a(configuration.cpp.o): In function `operator<<':
/home/fys/Desktop/incubator-brpc/output/include/butil/endpoint.h:163: undefined reference to `butil::ip2str(in_addr)'
../output/lib/libbraft.a(cli.cpp.o): In function `get_leader':
/home/fys/Desktop/braft/src/braft/cli.cpp:55: undefined reference to `butil::Status::error_str() const'
/home/fys/Desktop/braft/src/braft/cli.cpp:58: undefined reference to `brpc::Controller::ErrorText() const'
/home/fys/Desktop/braft/src/braft/cli.cpp:58: undefined reference to `butil::endpoint2str(butil::EndPoint const&)'
/home/fys/Desktop/braft/src/braft/cli.cpp:60: undefined reference to `brpc::Controller::~Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:60: undefined reference to `brpc::Channel::~Channel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:37: undefined reference to `brpc::Channel::Channel(brpc::ProfilerLinker)'
/home/fys/Desktop/braft/src/braft/cli.cpp:38: undefined reference to `brpc::Channel::Init(butil::EndPoint, brpc::ChannelOptions const*)'
/home/fys/Desktop/braft/src/braft/cli.cpp:45: undefined reference to `brpc::Controller::Controller()'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::to_string() const':
/home/fys/Desktop/braft/src/braft/configuration.h:75: undefined reference to `butil::endpoint2str(butil::EndPoint const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `get_leader':
/home/fys/Desktop/braft/src/braft/cli.cpp:49: undefined reference to `brpc::Controller::Failed() const'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
../output/lib/libbraft.a(cli.cpp.o): In function `get_leader':
/home/fys/Desktop/braft/src/braft/cli.cpp:53: undefined reference to `brpc::Controller::ErrorText() const'
/home/fys/Desktop/braft/src/braft/cli.cpp:53: undefined reference to `butil::endpoint2str(butil::EndPoint const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `get_leader':
/usr/include/c++/4.8.2/bits/basic_string.h:539: undefined reference to `brpc::Channel::~Channel()'
../output/lib/libbraft.a(cli.cpp.o): In function `Status':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:119: undefined reference to `butil::Status::copy_state(butil::Status::State const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `get_leader':
/home/fys/Desktop/braft/src/braft/cli.cpp:63: undefined reference to `brpc::Channel::~Channel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:45: undefined reference to `brpc::Controller::~Controller()'
../output/lib/libbraft.a(cli.cpp.o): In function `Status':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:119: undefined reference to `butil::Status::copy_state(butil::Status::State const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::add_peer(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:75: undefined reference to `brpc::Channel::Channel(brpc::ProfilerLinker)'
/home/fys/Desktop/braft/src/braft/cli.cpp:76: undefined reference to `brpc::Channel::Init(butil::EndPoint, brpc::ChannelOptions const*)'
/home/fys/Desktop/braft/src/braft/cli.cpp:85: undefined reference to `brpc::Controller::Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:86: undefined reference to `brpc::Controller::set_timeout_ms(long)'
/home/fys/Desktop/braft/src/braft/cli.cpp:87: undefined reference to `brpc::Controller::set_max_retry(int)'
/home/fys/Desktop/braft/src/braft/cli.cpp:91: undefined reference to `brpc::Controller::Failed() const'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
../output/lib/libbraft.a(cli.cpp.o): In function `CheckEQImpl':
/home/fys/Desktop/incubator-brpc/output/include/butil/logging.h:636: undefined reference to `std::string* logging::MakeCheckOpString<int, int>(int const&, int const&, char const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `PeerId':
/home/fys/Desktop/braft/src/braft/configuration.h:46: undefined reference to `logging::LogMessage::LogMessage(char const*, int, std::string*)'
/home/fys/Desktop/braft/src/braft/configuration.h:46: undefined reference to `logging::LogMessage::~LogMessage()'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::to_string() const':
/home/fys/Desktop/braft/src/braft/configuration.h:75: undefined reference to `butil::endpoint2str(butil::EndPoint const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::add_peer(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:75: undefined reference to `brpc::Channel::~Channel()'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
../output/lib/libbraft.a(cli.cpp.o): In function `CheckEQImpl':
/home/fys/Desktop/incubator-brpc/output/include/butil/logging.h:636: undefined reference to `std::string* logging::MakeCheckOpString<int, int>(int const&, int const&, char const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `PeerId':
/home/fys/Desktop/braft/src/braft/configuration.h:46: undefined reference to `logging::LogMessage::LogMessage(char const*, int, std::string*)'
/home/fys/Desktop/braft/src/braft/configuration.h:46: undefined reference to `logging::LogMessage::~LogMessage()'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::add_peer(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:102: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:85: undefined reference to `brpc::Controller::~Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:92: undefined reference to `brpc::Controller::ErrorText() const'
../output/lib/libbraft.a(cli.cpp.o): In function `Status':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:69: undefined reference to `butil::Status::set_error(int, butil::BasicStringPiece<std::string> const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::add_peer(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:102: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/src/braft/cli.cpp:102: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/src/braft/cli.cpp:75: undefined reference to `brpc::Channel::~Channel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:85: undefined reference to `brpc::Controller::~Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:102: undefined reference to `logging::LogMessage::~LogMessage()'
../output/lib/libbraft.a(cli.cpp.o): In function `Status':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:119: undefined reference to `butil::Status::copy_state(butil::Status::State const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::remove_peer(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:113: undefined reference to `brpc::Channel::Channel(brpc::ProfilerLinker)'
/home/fys/Desktop/braft/src/braft/cli.cpp:114: undefined reference to `brpc::Channel::Init(butil::EndPoint, brpc::ChannelOptions const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::to_string() const':
/home/fys/Desktop/braft/src/braft/configuration.h:75: undefined reference to `butil::endpoint2str(butil::EndPoint const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::remove_peer(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:123: undefined reference to `brpc::Controller::Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:124: undefined reference to `brpc::Controller::set_timeout_ms(long)'
/home/fys/Desktop/braft/src/braft/cli.cpp:125: undefined reference to `brpc::Controller::set_max_retry(int)'
/home/fys/Desktop/braft/src/braft/cli.cpp:129: undefined reference to `brpc::Controller::Failed() const'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
../output/lib/libbraft.a(cli.cpp.o): In function `CheckEQImpl':
/home/fys/Desktop/incubator-brpc/output/include/butil/logging.h:636: undefined reference to `std::string* logging::MakeCheckOpString<int, int>(int const&, int const&, char const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `PeerId':
/home/fys/Desktop/braft/src/braft/configuration.h:46: undefined reference to `logging::LogMessage::LogMessage(char const*, int, std::string*)'
/home/fys/Desktop/braft/src/braft/configuration.h:46: undefined reference to `logging::LogMessage::~LogMessage()'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::remove_peer(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:113: undefined reference to `brpc::Channel::~Channel()'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
../output/lib/libbraft.a(cli.cpp.o): In function `CheckEQImpl':
/home/fys/Desktop/incubator-brpc/output/include/butil/logging.h:636: undefined reference to `std::string* logging::MakeCheckOpString<int, int>(int const&, int const&, char const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `PeerId':
/home/fys/Desktop/braft/src/braft/configuration.h:46: undefined reference to `logging::LogMessage::LogMessage(char const*, int, std::string*)'
/home/fys/Desktop/braft/src/braft/configuration.h:46: undefined reference to `logging::LogMessage::~LogMessage()'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::remove_peer(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:140: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:123: undefined reference to `brpc::Controller::~Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:130: undefined reference to `brpc::Controller::ErrorText() const'
../output/lib/libbraft.a(cli.cpp.o): In function `Status':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:69: undefined reference to `butil::Status::set_error(int, butil::BasicStringPiece<std::string> const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::remove_peer(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:140: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/src/braft/cli.cpp:140: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/src/braft/cli.cpp:113: undefined reference to `brpc::Channel::~Channel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:123: undefined reference to `brpc::Controller::~Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:140: undefined reference to `logging::LogMessage::~LogMessage()'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::reset_peer(std::string const&, braft::PeerId const&, braft::Configuration const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:152: undefined reference to `brpc::Channel::Channel(brpc::ProfilerLinker)'
/home/fys/Desktop/braft/src/braft/cli.cpp:153: undefined reference to `brpc::Channel::Init(butil::EndPoint, brpc::ChannelOptions const*)'
/home/fys/Desktop/braft/src/braft/cli.cpp:157: undefined reference to `brpc::Controller::Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:158: undefined reference to `brpc::Controller::set_timeout_ms(long)'
/home/fys/Desktop/braft/src/braft/cli.cpp:159: undefined reference to `brpc::Controller::set_max_retry(int)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::to_string() const':
/home/fys/Desktop/braft/src/braft/configuration.h:75: undefined reference to `butil::endpoint2str(butil::EndPoint const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::reset_peer(std::string const&, braft::PeerId const&, braft::Configuration const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:173: undefined reference to `brpc::Channel::~Channel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:170: undefined reference to `brpc::Controller::Failed() const'
/home/fys/Desktop/braft/src/braft/cli.cpp:157: undefined reference to `brpc::Controller::~Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:171: undefined reference to `brpc::Controller::ErrorText() const'
../output/lib/libbraft.a(cli.cpp.o): In function `Status':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:69: undefined reference to `butil::Status::set_error(int, butil::BasicStringPiece<std::string> const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::reset_peer(std::string const&, braft::PeerId const&, braft::Configuration const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:157: undefined reference to `brpc::Controller::~Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:173: undefined reference to `brpc::Channel::~Channel()'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::snapshot(std::string const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:178: undefined reference to `brpc::Channel::Channel(brpc::ProfilerLinker)'
/home/fys/Desktop/braft/src/braft/cli.cpp:179: undefined reference to `brpc::Channel::Init(butil::EndPoint, brpc::ChannelOptions const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::to_string() const':
/home/fys/Desktop/braft/src/braft/configuration.h:75: undefined reference to `butil::endpoint2str(butil::EndPoint const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::snapshot(std::string const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:195: undefined reference to `brpc::Channel::~Channel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:183: undefined reference to `brpc::Controller::Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:184: undefined reference to `brpc::Controller::set_timeout_ms(long)'
/home/fys/Desktop/braft/src/braft/cli.cpp:185: undefined reference to `brpc::Controller::set_max_retry(int)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::to_string() const':
/home/fys/Desktop/braft/src/braft/configuration.h:75: undefined reference to `butil::endpoint2str(butil::EndPoint const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::snapshot(std::string const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:192: undefined reference to `brpc::Controller::Failed() const'
/home/fys/Desktop/braft/src/braft/cli.cpp:183: undefined reference to `brpc::Controller::~Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:193: undefined reference to `brpc::Controller::ErrorText() const'
../output/lib/libbraft.a(cli.cpp.o): In function `Status':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:69: undefined reference to `butil::Status::set_error(int, butil::BasicStringPiece<std::string> const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::snapshot(std::string const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:183: undefined reference to `brpc::Controller::~Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:195: undefined reference to `brpc::Channel::~Channel()'
../output/lib/libbraft.a(cli.cpp.o): In function `Status':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:119: undefined reference to `butil::Status::copy_state(butil::Status::State const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::change_peers(std::string const&, braft::Configuration const&, braft::Configuration const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:204: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:206: undefined reference to `brpc::Channel::Channel(brpc::ProfilerLinker)'
/home/fys/Desktop/braft/src/braft/cli.cpp:207: undefined reference to `brpc::Channel::Init(butil::EndPoint, brpc::ChannelOptions const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::to_string() const':
/home/fys/Desktop/braft/src/braft/configuration.h:75: undefined reference to `butil::endpoint2str(butil::EndPoint const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::change_peers(std::string const&, braft::Configuration const&, braft::Configuration const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:206: undefined reference to `brpc::Channel::~Channel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:220: undefined reference to `brpc::Controller::Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:221: undefined reference to `brpc::Controller::set_timeout_ms(long)'
/home/fys/Desktop/braft/src/braft/cli.cpp:222: undefined reference to `brpc::Controller::set_max_retry(int)'
/home/fys/Desktop/braft/src/braft/cli.cpp:226: undefined reference to `brpc::Controller::Failed() const'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
../output/lib/libbraft.a(cli.cpp.o): In function `CheckEQImpl':
/home/fys/Desktop/incubator-brpc/output/include/butil/logging.h:636: undefined reference to `std::string* logging::MakeCheckOpString<int, int>(int const&, int const&, char const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `PeerId':
/home/fys/Desktop/braft/src/braft/configuration.h:46: undefined reference to `logging::LogMessage::LogMessage(char const*, int, std::string*)'
/home/fys/Desktop/braft/src/braft/configuration.h:46: undefined reference to `logging::LogMessage::~LogMessage()'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::parse(std::string const&)':
/home/fys/Desktop/braft/src/braft/configuration.h:66: undefined reference to `butil::str2ip(char const*, in_addr*)'
../output/lib/libbraft.a(cli.cpp.o): In function `CheckEQImpl':
/home/fys/Desktop/incubator-brpc/output/include/butil/logging.h:636: undefined reference to `std::string* logging::MakeCheckOpString<int, int>(int const&, int const&, char const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `PeerId':
/home/fys/Desktop/braft/src/braft/configuration.h:46: undefined reference to `logging::LogMessage::LogMessage(char const*, int, std::string*)'
/home/fys/Desktop/braft/src/braft/configuration.h:46: undefined reference to `logging::LogMessage::~LogMessage()'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::change_peers(std::string const&, braft::Configuration const&, braft::Configuration const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:237: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:220: undefined reference to `brpc::Controller::~Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:227: undefined reference to `brpc::Controller::ErrorText() const'
../output/lib/libbraft.a(cli.cpp.o): In function `Status':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:69: undefined reference to `butil::Status::set_error(int, butil::BasicStringPiece<std::string> const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::change_peers(std::string const&, braft::Configuration const&, braft::Configuration const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:204: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/src/braft/cli.cpp:204: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/src/braft/cli.cpp:237: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/src/braft/cli.cpp:237: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/src/braft/cli.cpp:206: undefined reference to `brpc::Channel::~Channel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:204: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/src/braft/cli.cpp:220: undefined reference to `brpc::Controller::~Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:237: undefined reference to `logging::LogMessage::~LogMessage()'
../output/lib/libbraft.a(cli.cpp.o): In function `Status':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:119: undefined reference to `butil::Status::copy_state(butil::Status::State const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::transfer_leader(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:252: undefined reference to `brpc::Channel::Channel(brpc::ProfilerLinker)'
/home/fys/Desktop/braft/src/braft/cli.cpp:253: undefined reference to `brpc::Channel::Init(butil::EndPoint, brpc::ChannelOptions const*)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::to_string() const':
/home/fys/Desktop/braft/src/braft/configuration.h:75: undefined reference to `butil::endpoint2str(butil::EndPoint const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::transfer_leader(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:264: undefined reference to `brpc::Controller::Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:265: undefined reference to `brpc::Controller::set_timeout_ms(long)'
/home/fys/Desktop/braft/src/braft/cli.cpp:266: undefined reference to `brpc::Controller::set_max_retry(int)'
/home/fys/Desktop/braft/src/braft/cli.cpp:269: undefined reference to `brpc::Controller::Failed() const'
/home/fys/Desktop/braft/src/braft/cli.cpp:264: undefined reference to `brpc::Controller::~Controller()'
/home/fys/Desktop/braft/src/braft/cli.cpp:252: undefined reference to `brpc::Channel::~Channel()'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::to_string() const':
/home/fys/Desktop/braft/src/braft/configuration.h:75: undefined reference to `butil::endpoint2str(butil::EndPoint const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::transfer_leader(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:249: undefined reference to `logging::GetMinLogLevel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:270: undefined reference to `brpc::Controller::ErrorText() const'
../output/lib/libbraft.a(cli.cpp.o): In function `Status':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:69: undefined reference to `butil::Status::set_error(int, butil::BasicStringPiece<std::string> const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::cli::transfer_leader(std::string const&, braft::Configuration const&, braft::PeerId const&, braft::cli::CliOptions const&)':
/home/fys/Desktop/braft/src/braft/cli.cpp:249: undefined reference to `logging::LogMessage::LogMessage(char const*, int, int)'
/home/fys/Desktop/braft/src/braft/cli.cpp:249: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/src/braft/cli.cpp:252: undefined reference to `brpc::Channel::~Channel()'
/home/fys/Desktop/braft/src/braft/cli.cpp:249: undefined reference to `logging::LogMessage::~LogMessage()'
/home/fys/Desktop/braft/src/braft/cli.cpp:264: undefined reference to `brpc::Controller::~Controller()'
../output/lib/libbraft.a(cli.cpp.o): In function `butil::Status::Status(int, char const*, ...)':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:65: undefined reference to `butil::Status::set_errorv(int, char const*, __va_list_tag*)'
../output/lib/libbraft.a(cli.cpp.o): In function `butil::Status::set_error(int, char const*, ...)':
/home/fys/Desktop/incubator-brpc/output/include/butil/status.h:125: undefined reference to `butil::Status::set_errorv(int, char const*, __va_list_tag*)'
../output/lib/libbraft.a(cli.cpp.o): In function `braft::PeerId::to_string() const':
/home/fys/Desktop/braft/src/braft/configuration.h:75: undefined reference to `butil::endpoint2str(butil::EndPoint const&)'
../output/lib/libbraft.a(cli.cpp.o): In function `operator<<':
/home/fys/Desktop/incubator-brpc/output/include/butil/endpoint.h:163: undefined reference to `butil::ip2str(in_addr)'
../output/lib/libbraft.a(cli.cpp.o): In function `__static_initialization_and_destruction_1':
/home/fys/Desktop/incubator-brpc/output/include/butil/class_name.h:35: undefined reference to `butil::demangle(char const*)'
/home/fys/Desktop/incubator-brpc/output/include/butil/class_name.h:35: undefined reference to `butil::demangle(char const*)'
/home/fys/Desktop/incubator-brpc/output/include/butil/class_name.h:35: undefined reference to `butil::demangle(char const*)'
/home/fys/Desktop/incubator-brpc/output/include/butil/class_name.h:35: undefined reference to `butil::demangle(char const*)'
collect2: error: ld returned 1 exit status
make[2]: *** [output/bin/braft_cli] Error 1
make[1]: *** [tools/CMakeFiles/braft_cli.dir/all] Error 2
make: *** [all] Error 2  

在CMake时已经将

set(BRPC_INCLUDE_PATH "/home/fys/Desktop/incubator-brpc/output/include")
set(BRPC_LIB "/home/fys/Desktop/incubator-brpc/output/lib")

不知道为什么仍有许多undefined reference

求各位大佬指教!

感谢!

hanxuan123 commented 3 years ago

set(BRPC_LIB "/home/fys/Desktop/incubator-brpc/output/lib") 这句话改为set(BRPC_LIB "/home/fys/Desktop/incubator-brpc/output/lib/libbrpc.a")试试

Magnomic commented 3 years ago

set(BRPC_LIB "/home/fys/Desktop/incubator-brpc/output/lib") 这句话改为set(BRPC_LIB "/home/fys/Desktop/incubator-brpc/output/lib/libbrpc.a")试试

可以解决,感谢

Zrealshadow commented 2 years ago

set(BRPC_LIB "/home/fys/Desktop/incubator-brpc/output/lib") 这句话改为set(BRPC_LIB "/home/fys/Desktop/incubator-brpc/output/lib/libbrpc.a")试试

您好,我用vcpkg工具链进行编译,也出现了这个问题,您能解释一下原因吗