baidu / baidu/braft

Compile error

Open
#488 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
4.2k
Forks
923
PR merge metrics
No merged PRs in 30d

Description

Current master branch code

compile command

> mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/home/guoyande/guoyande/lib/braft -DBRPC_INCLUDE_PATH=/home/guoyande/guoyande/lib/brpc/include -DBRPC_LIB=/home/guoyande/guoyande/lib/brpc/lib64 && make -j8

error
> [ 93%] Linking CXX shared library ../output/lib/libbraft.so
[ 95%] Linking CXX static library ../output/lib/libbraft.a
[ 95%] Built target braft-static
[ 97%] Building CXX object tools/CMakeFiles/braft_cli.dir/braft_cli.cpp.o
[ 97%] Built target braft-shared
[100%] Linking CXX executable output/bin/braft_cli
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/braft_cli.dir/braft_cli.cpp.o: in function `braft::PeerId::parse(std::string const&)':
/home/guoyande/guoyande/program/braft/src/braft/configuration.h:87: undefined reference to `butil::str2ip(char const*, in_addr*)'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/braft_cli.dir/braft_cli.cpp.o: in function `braft::cli::snapshot()':
/home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:153: undefined reference to `logging::GetMinLogLevel()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/braft_cli.dir/braft_cli.cpp.o: in function `braft::PeerId::~PeerId()':
/home/guoyande/guoyande/program/braft/src/braft/configuration.h:43: undefined reference to `butil::EndPoint::~EndPoint()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/braft_cli.dir/braft_cli.cpp.o: in function `braft::cli::snapshot()':
/home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:142: undefined reference to `logging::GetMinLogLevel()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:141: undefined reference to `logging::GetMinLogLevel()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:141: undefined reference to `logging::LogMessage::LogMessage(char const*, int, char const*, int)'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:142: undefined reference to `logging::LogMessage::~LogMessage()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:145: undefined reference to `logging::GetMinLogLevel()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:142: undefined reference to `logging::LogMessage::LogMessage(char const*, int, char const*, int)'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:145: undefined reference to `logging::LogMessage::LogMessage(char const*, int, char const*, int)'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:145: undefined reference to `logging::LogMessage::~LogMessage()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:153: undefined reference to `logging::LogMessage::LogMessage(char const*, int, char const*, int)'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/braft_cli.dir/braft_cli.cpp.o: in function `butil::operator<<(std::ostream&, butil::Status const&)':
/chj/guoyande/lib/brpc/include/butil/status.h:152: undefined reference to `butil::operator<<(std::ostream&, butil::BasicStringPiece const&)'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/braft_cli.dir/braft_cli.cpp.o: in function `braft::cli::snapshot()':
/home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:153: undefined reference to `logging::LogMessage::~LogMessage()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/braft_cli.dir/braft_cli.cpp.o: in function `braft::cli::add_peer()':
/home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:43: undefined reference to `logging::GetMinLogLevel()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:42: undefined reference to `logging::GetMinLogLevel()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:42: undefined reference to `logging::LogMessage::LogMessage(char const*, int, char const*, int)'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:41: undefined reference to `logging::GetMinLogLevel()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:41: undefined reference to `logging::LogMessage::LogMessage(char const*, int, char const*, int)'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:43: undefined reference to `logging::LogMessage::~LogMessage()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/braft_cli.dir/braft_cli.cpp.o: in function `braft::PeerId::parse(std::string const&)':
/home/guoyande/guoyande/program/braft/src/braft/configuration.h:87: undefined reference to `butil::str2ip(char const*, in_addr*)'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/braft_cli.dir/braft_cli.cpp.o: in function `braft::cli::add_peer()':
/home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:59: undefined reference to `logging::GetMinLogLevel()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/braft_cli.dir/braft_cli.cpp.o: in function `braft::PeerId::~PeerId()':
/home/guoyande/guoyande/program/braft/src/braft/configuration.h:43: undefined reference to `butil::EndPoint::~EndPoint()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/braft_cli.dir/braft_cli.cpp.o: in function `braft::cli::add_peer()':
/home/guoyande/guoyande/program/braft/tools/braft_cli.cpp:46: undefined reference to `logging::GetMinLogLevel()'

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with the provided CMake and make command, then inspect the braft_cli target and its link dependencies. Read tools/braft_cli.cpp and src/braft/configuration.h alongside the linker output; done means braft_cli links successfully and the build completes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.