ubuntu 安装 boost 1.66.0

QTum Ubuntu 编译
Boost库错误

错误内容

root@4f5767887f5b:/cloud/qtum/qtum# make
Making all in src
make[1]: Entering directory '/cloud/qtum/qtum/src'
make[2]: Entering directory '/cloud/qtum/qtum/src'
  CXXLD    qtumd
libbitcoin_common.a(libbitcoin_common_a-State.o): In function `unsigned long boost::random::detail::generate_uniform_int::random::random_device, unsigned long>(boost::random::random_device&, unsigned long, unsigned long, mpl_::bool_)':
/usr/include/boost/random/uniform_int_distribution.hpp:115: undefined reference to `boost::random::random_device::operator()()'
/usr/include/boost/random/uniform_int_distribution.hpp:202: undefined reference to `boost::random::random_device::operator()()'
/usr/include/boost/random/uniform_int_distribution.hpp:67: undefined reference to `boost::random::random_device::operator()()'
libbitcoin_common.a(libbitcoin_common_a-State.o): In function `unsigned short boost::random::detail::generate_uniform_int::random::random_device, unsigned short>(boost::random::random_device&, unsigned short, unsigned short, mpl_::bool_)':
/usr/include/boost/random/uniform_int_distribution.hpp:202: undefined reference to `boost::random::random_device::operator()()'
libbitcoin_common.a(libbitcoin_common_a-ICAP.o): In function `unsigned short boost::random::detail::generate_uniform_int::random::random_device, unsigned short>(boost::random::random_device&, unsigned short, unsigned short, mpl_::bool_)':
/usr/include/boost/random/uniform_int_distribution.hpp:202: undefined reference to `boost::random::random_device::operator()()'
libbitcoin_common.a(libbitcoin_common_a-Common.o):/usr/include/boost/random/uniform_int_distribution.hpp:202: more undefined references to `boost::random::random_device::operator()()' follow
libbitcoin_common.a(libbitcoin_common_a-FixedHash.o): In function `_GLOBAL__sub_I__ZN3dev17s_fixedHashEngineE':
/cloud/qtum/qtum/src/cpp-ethereum/libdevcore/FixedHash.cpp:29: undefined reference to `boost::random::random_device::random_device()'
/cloud/qtum/qtum/src/cpp-ethereum/libdevcore/FixedHash.cpp:29: undefined reference to `boost::random::random_device::~random_device()'
collect2: error: ld returned 1 exit status
Makefile:5077: recipe for target 'qtumd' failed
make[2]: *** [qtumd] Error 1
make[2]: Leaving directory '/cloud/qtum/qtum/src'
Makefile:13546: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/cloud/qtum/qtum/src'
Makefile:693: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

解决办法

# 首先删除本地原有的 boost 库
rm -f /usr/lib/libboost*
rm -fr 'find / -name libboost*'
# 移除boost头文件
mv /usr/include/boost /usr/include/boost-bak
# 下载 wget
apt-get install wget
# 下载Boost库
wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz
tar -zxvf boost_1_66_0.tar.gz
cd boost_1_66_0
# 构建符合环境的脚本
./bootstrap.sh
# 编译你懂得
./b2 install

你可能感兴趣的:(Linux)