I have #include <boost/program_options.hpp in my C++ code, but when I compile it, I get the following error ( it is long, but the gist is there is something wrong with how I use program_options.hpp ):
>wavenet_server.cc:(.text+0x5df): undefined reference to `boost::program_options::options_description::m_default_line_length'
wavenet_server.cc:(.text+0x5e5): undefined reference to `boost::program_options::options_description::m_default_line_length'
wavenet_server.cc:(.text+0x5ff): undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
wavenet_server.cc:(.text+0x62c): undefined reference to `boost::program_options::options_description::add_options()'
wavenet_server.cc:(.text+0x673): undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)'
wavenet_server.cc:(.text+0x6af): undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)'
wavenet_server.cc:(.text+0x6eb): undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)'
wavenet_server.cc:(.text+0x727): undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)'
wavenet_server.cc:(.text+0x763): undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:wavenet_server.cc:(.text+0x79f): more undefined references to `boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)' follow
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `main':
wavenet_server.cc:(.text+0x862): undefined reference to `boost::program_options::variables_map::variables_map()'
wavenet_server.cc:(.text+0x8c2): undefined reference to `boost::program_options::store(boost::program_options::basic_parsed_options<char> const&, boost::program_options::variables_map&, bool)'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::error_with_option_name::~error_with_option_name()':
wavenet_server.cc:(.text._ZN5boost15program_options22error_with_option_nameD2Ev[_ZN5boost15program_options22error_with_option_nameD5Ev]+0xd): undefined reference to `vtable for boost::program_options::error_with_option_name'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::string const&, std::string const&, int)':
wavenet_server.cc:(.text._ZN5boost15program_options16validation_errorC2ENS1_6kind_tERKSsS4_i[_ZN5boost15program_options16validation_errorC5ENS1_6kind_tERKSsS4_i]+0x32): undefined reference to `boost::program_options::validation_error::get_template(boost::program_options::validation_error::kind_t)'
wavenet_server.cc:(.text._ZN5boost15program_options16validation_errorC2ENS1_6kind_tERKSsS4_i[_ZN5boost15program_options16validation_errorC5ENS1_6kind_tERKSsS4_i]+0x4f): undefined reference to `boost::program_options::error_with_option_name::error_with_option_name(std::string const&, std::string const&, std::string const&, int)'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::value_semantic_codecvt_helper<char>::value_semantic_codecvt_helper()':
wavenet_server.cc:(.text._ZN5boost15program_options29value_semantic_codecvt_helperIcEC2Ev[_ZN5boost15program_options29value_semantic_codecvt_helperIcEC5Ev]+0x19): undefined reference to `vtable for boost::program_options::value_semantic_codecvt_helper<char>'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::value_semantic_codecvt_helper<char>::~value_semantic_codecvt_helper()':
wavenet_server.cc:(.text._ZN5boost15program_options29value_semantic_codecvt_helperIcED2Ev[_ZN5boost15program_options29value_semantic_codecvt_helperIcED5Ev]+0xd): undefined reference to `vtable for boost::program_options::value_semantic_codecvt_helper<char>'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::variables_map::operator[](std::string const&) const':
wavenet_server.cc:(.text._ZNK5boost15program_options13variables_mapixERKSs[_ZNK5boost15program_options13variables_mapixERKSs]+0x1f): undefined reference to `boost::program_options::abstract_variables_map::operator[](std::string const&) const'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `WavenetServiceImpl::setWavenet()':
wavenet_server.cc:(.text._ZN18WavenetServiceImpl10setWavenetEv[_ZN18WavenetServiceImpl10setWavenetEv]+0xdd): undefined reference to `make_wavenet'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `WavenetServiceImpl::threadWavenetInfer(void*)':
wavenet_server.cc:(.text._ZN18WavenetServiceImpl18threadWavenetInferEPv[_ZN18WavenetServiceImpl18threadWavenetInferEPv]+0x4f): undefined reference to `infer'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*)':
wavenet_server.cc:(.text._ZN5boost15program_options25basic_command_line_parserIcEC2EiPKPKc[_ZN5boost15program_options25basic_command_line_parserIcEC5EiPKPKc]+0x72): undefined reference to `boost::program_options::detail::cmdline::cmdline(std::vector<std::string, std::allocator<std::string> > const&)'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::basic_command_line_parser<char>::options(boost::program_options::options_description const&)':
wavenet_server.cc:(.text._ZN5boost15program_options25basic_command_line_parserIcE7optionsERKNS0_19options_descriptionE[_ZN5boost15program_options25basic_command_line_parserIcE7optionsERKNS0_19options_descriptionE]+0x1f): undefined reference to `boost::program_options::detail::cmdline::set_options_description(boost::program_options::options_description const&)'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::basic_command_line_parser<char>::style(int)':
wavenet_server.cc:(.text._ZN5boost15program_options25basic_command_line_parserIcE5styleEi[_ZN5boost15program_options25basic_command_line_parserIcE5styleEi]+0x1c): undefined reference to `boost::program_options::detail::cmdline::style(int)'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::basic_command_line_parser<char>::extra_parser(boost::function1<std::pair<std::string, std::string>, std::string const&>)':
wavenet_server.cc:(.text._ZN5boost15program_options25basic_command_line_parserIcE12extra_parserENS_9function1ISt4pairISsSsERKSsEE[_ZN5boost15program_options25basic_command_line_parserIcE12extra_parserENS_9function1ISt4pairISsSsERKSsEE]+0x33): undefined reference to `boost::program_options::detail::cmdline::set_additional_parser(boost::function1<std::pair<std::string, std::string>, std::string const&>)'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::basic_command_line_parser<char>::run()':
wavenet_server.cc:(.text._ZN5boost15program_options25basic_command_line_parserIcE3runEv[_ZN5boost15program_options25basic_command_line_parserIcE3runEv]+0x19): undefined reference to `boost::program_options::detail::cmdline::get_canonical_option_prefix()'
wavenet_server.cc:(.text._ZN5boost15program_options25basic_command_line_parserIcE3runEv[_ZN5boost15program_options25basic_command_line_parserIcE3runEv]+0x45): undefined reference to `boost::program_options::detail::cmdline::run()'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.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&)':
wavenet_server.cc:(.text._ZN5boost15program_options11to_internalISsEESt6vectorISsSaISsEERKS2_IT_SaIS5_EE[_ZN5boost15program_options11to_internalISsEESt6vectorISsSaISsEERKS2_IT_SaIS5_EE]+0x5d): undefined reference to `boost::program_options::to_internal(std::string const&)'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost15program_options11typed_valueIicEE[_ZTVN5boost15program_options11typed_valueIicEE]+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'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost15program_options20invalid_option_valueE[_ZTVN5boost15program_options20invalid_option_valueE]+0x20): undefined reference to `boost::program_options::error_with_option_name::what() const'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost15program_options20invalid_option_valueE[_ZTVN5boost15program_options20invalid_option_valueE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost15program_options16validation_errorE[_ZTVN5boost15program_options16validation_errorE]+0x20): undefined reference to `boost::program_options::error_with_option_name::what() const'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost15program_options16validation_errorE[_ZTVN5boost15program_options16validation_errorE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTIN5boost15program_options11typed_valueIicEE[_ZTIN5boost15program_options11typed_valueIicEE]+0x18): undefined reference to `typeinfo for boost::program_options::value_semantic_codecvt_helper<char>'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTIN5boost15program_options16validation_errorE[_ZTIN5boost15program_options16validation_errorE]+0x10): undefined reference to `typeinfo for boost::program_options::error_with_option_name'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::variables_map::~variables_map()':
wavenet_server.cc:(.text._ZN5boost15program_options13variables_mapD2Ev[_ZN5boost15program_options13variables_mapD5Ev]+0xd): undefined reference to `vtable for boost::program_options::variables_map'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::typed_value<int, char>::name() const':
wavenet_server.cc:(.text._ZNK5boost15program_options11typed_valueIicE4nameEv[_ZNK5boost15program_options11typed_valueIicE4nameEv]+0x26): undefined reference to `boost::program_options::arg'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `void boost::program_options::validate<int, char>(boost::any&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, int*, long)':
wavenet_server.cc:(.text._ZN5boost15program_options8validateIicEEvRNS_3anyERKSt6vectorISbIT0_St11char_traitsIS5_ESaIS5_EESaIS9_EEPT_l[_ZN5boost15program_options8validateIicEEvRNS_3anyERKSt6vectorISbIT0_St11char_traitsIS5_ESaIS5_EESaIS9_EEPT_l]+0x33): undefined reference to `boost::program_options::validators::check_first_occurrence(boost::any const&)'
wavenet_server.cc:(.text._ZN5boost15program_options8validateIicEEvRNS_3anyERKSt6vectorISbIT0_St11char_traitsIS5_ESaIS5_EESaIS9_EEPT_l[_ZN5boost15program_options8validateIicEEvRNS_3anyERKSt6vectorISbIT0_St11char_traitsIS5_ESaIS5_EESaIS9_EEPT_l]+0xf3): undefined reference to `boost::program_options::invalid_option_value::invalid_option_value(std::string const&)'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o: In function `boost::program_options::error_with_option_name::error_with_option_name(boost::program_options::error_with_option_name const&)':
wavenet_server.cc:(.text._ZN5boost15program_options22error_with_option_nameC2ERKS1_[_ZN5boost15program_options22error_with_option_nameC5ERKS1_]+0x25): undefined reference to `vtable for boost::program_options::error_with_option_name'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE]+0x28): undefined reference to `boost::program_options::error_with_option_name::what() const'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE]+0x38): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE]+0x20): undefined reference to `boost::program_options::error_with_option_name::what() const'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x28): undefined reference to `boost::program_options::error_with_option_name::what() const'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x38): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x20): undefined reference to `boost::program_options::error_with_option_name::what() const'
/tmp/tmpxft_0001ab46_00000000-5_wavenet_server.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x30): undefined reference to `boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
collect2: error: ld returned 1 exit status
make: *** [Makefile:60: wavenet_server] Error 1
I am using:
gcc version 7.3.1 20180303 (Red Hat 7.3.1-5)
Currently, I am using boost package that I have installed through: yun install boost
However, in theboost installation guide, it says "program_options.hpp" is one of the libraries that needs to be "built". My question is: 1. Am I getting errors becuase I have not "built" it from source file and installed through yum? 2. If not, then for what other reason could I be getting such errors?
Aucun commentaire:
Enregistrer un commentaire