print_floats.cpp:**undefined reference to `boost::program_options

2018-08-06 21:45:45

编译EOS时出现以下错误

Scanning dependencies of target print_floats
......
[ 76%] Linking CXX executable print_floats
CMakeFiles/print_floats.dir/print_floats.cpp.o: In function `boost::program_options::typed_value<unsigned int, char>::name[abi:cxx11]() const':
print_floats.cpp: **undefined reference to `boost::program_options::arg[abi:cxx11]'**
......
print_floats.cpp:**undefined reference to `boost::program_options::validation_error::get_template[abi:cxx11]**(boost::program_options::validation_error::kind_t)'
print_floats.cpp:**undefined reference to `boost::program_options::options_description::m_default_line_length'**
print_floats.cpp:**undefined reference to `boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)'**
print_floats.cpp:**undefined reference to `boost::program_options::options_description::add_options()'**
print_floats.cpp:**undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, char const*)'**
print_floats.cpp:**undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)'**
......
collect2: error: ld returned 1 exit status
make[2]: *** [tools/print_floats] Error 1
make[1]: *** [tools/CMakeFiles/print_floats.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 76%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/sha512.cpp.o
[ 76%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/dh.cpp.o
[ 76%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/blowfish.cpp.o

原因是之前手动安装过boost,但安装的不正确,或者文件缺失

解决方案,清理掉所有本地的boost文件,重新运行编译EOS,会自动下载依赖

cd ~/opt/
rm -rf boost*
cd eos_dir
rm -rf build

问题收集自 eosfans

当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »