0

我第一次尝试构建 uhd 是使用我编写的脚本,该脚本过去曾在两台运行 14.04 的笔记本电脑上运行。在那之后,我回到了这里:

http://files.ettus.com/manual/page_build_guide.html#build_instructions_unix

在那之后,我去了这里:

https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux

我收到以下编译错误。我很茫然,因为我已经安装了所有的 libboost,所以我不确定缺少什么。我正在 maint 分支上构建。我在运行 16.04 的新计算机上。

[ 61%] Built target uhd
[ 61%] Linking CXX executable sync_to_gps
CMakeFiles/sync_to_gps.dir/sync_to_gps.cpp.o: In function `_main(int, char**)':
sync_to_gps.cpp:(.text+0x6de): undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/sync_to_gps.dir/sync_to_gps.cpp.o: In function `boost::program_options::typed_value<std::string, char>::xparse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&) const':
sync_to_gps.cpp:(.text._ZNK5boost15program_options11typed_valueISscE6xparseERNS_3anyERKSt6vectorISsSaISsEE[_ZNK5boost15program_options11typed_valueISscE6xparseERNS_3anyERKSt6vectorISsSaISsEE]+0x1f): undefined reference to `boost::program_options::validate(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, std::string*, int)'
CMakeFiles/sync_to_gps.dir/sync_to_gps.cpp.o: In function `std::vector<std::string, std::allocator<std::string> > boost::program_options::to_internal<std::string>(std::vector<std::string, std::allocator<std::string> > const&)':
sync_to_gps.cpp:(.text._ZN5boost15program_options11to_internalISsEESt6vectorISsSaISsEERKS2_IT_SaIS5_EE[_ZN5boost15program_options11to_internalISsEESt6vectorISsSaISsEERKS2_IT_SaIS5_EE]+0x7d): undefined reference to `boost::program_options::to_internal(std::string const&)'
CMakeFiles/sync_to_gps.dir/sync_to_gps.cpp.o: In function `boost::program_options::basic_parsed_options<char> boost::program_options::parse_command_line<char>(int, char const* const*, boost::program_options::options_description const&, int, boost::function1<std::pair<std::string, std::string>, std::string const&>)':
sync_to_gps.cpp:(.text._ZN5boost15program_options18parse_command_lineIcEENS0_20basic_parsed_optionsIT_EEiPKPKS3_RKNS0_19options_descriptionEiNS_9function1ISt4pairISsSsERKSsEE[_ZN5boost15program_options18parse_command_lineIcEENS0_20basic_parsed_optionsIT_EEiPKPKS3_RKNS0_19options_descriptionEiNS_9function1ISt4pairISsSsERKSsEE]+0x15e): undefined reference to `boost::program_options::detail::cmdline::cmdline(std::vector<std::string, std::allocator<std::string> > const&)'
sync_to_gps.cpp:(.text._ZN5boost15program_options18parse_command_lineIcEENS0_20basic_parsed_optionsIT_EEiPKPKS3_RKNS0_19options_descriptionEiNS_9function1ISt4pairISsSsERKSsEE[_ZN5boost15program_options18parse_command_lineIcEENS0_20basic_parsed_optionsIT_EEiPKPKS3_RKNS0_19options_descriptionEiNS_9function1ISt4pairISsSsERKSsEE]+0x1ef): undefined reference to `boost::program_options::detail::cmdline::set_additional_parser(boost::function1<std::pair<std::string, std::string>, std::string const&>)'
CMakeFiles/sync_to_gps.dir/sync_to_gps.cpp.o: In function `boost::program_options::typed_value<std::string, char>::name() const':
sync_to_gps.cpp:(.text._ZNK5boost15program_options11typed_valueISscE4nameEv[_ZNK5boost15program_options11typed_valueISscE4nameEv]+0x29): undefined reference to `boost::program_options::arg'
CMakeFiles/sync_to_gps.dir/sync_to_gps.cpp.o:(.rodata._ZTVN5boost15program_options11typed_valueISscEE[_ZTVN5boost15program_options11typed_valueISscEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, bool) const'
../lib/libuhd.so.003.010: undefined reference to `boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::load(std::string&)'
../lib/libuhd.so.003.010: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > > const&)'
../lib/libuhd.so.003.010: undefined reference to `boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)'
../lib/libuhd.so.003.010: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
../lib/libuhd.so.003.010: undefined reference to `boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::save(std::string const&)'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/sync_to_gps.dir/build.make:107: recipe for target 'examples/sync_to_gps' failed
make[2]: *** [examples/sync_to_gps] Error 1
CMakeFiles/Makefile2:393: recipe for target 'examples/CMakeFiles/sync_to_gps.dir/all' failed
make[1]: *** [examples/CMakeFiles/sync_to_gps.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
4

1 回答 1

0

我有一个类似的问题,原来是旧版本的 GCC 仍然安装在我的 Ubuntu 系统上被调用。查看 /usr/bin/gcc 和 /usr/bin/g++ 并查看它们是否分别链接到 /usr/bin/gcc-5 和 /usr/bin/g++-5。

于 2016-10-12T21:02:55.310 回答