Boost C++ Libraries: Ticket #13173: "program_options" build fail. "boost::lambda" is working without any problem. https://svn.boost.org/trac10/ticket/13173 <p> Hello, </p> <p> "program_options" build fail. "boost::lambda" is working without any problem. </p> <p> This example below doesn't work: </p> <pre class="wiki">#include "boost/program_options.hpp" namespace po = boost::program_options; #include &lt;iostream&gt; #include &lt;iterator&gt; using namespace std; int main(int ac, char* av[]) { try { po::options_description desc("Allowed options"); desc.add_options() ("help", "produce help message") ("compression", po::value&lt;double&gt;(), "set compression level"); po::variables_map vm; po::store(po::parse_command_line(ac, av, desc), vm); po::notify(vm); if (vm.count("help")) { cout &lt;&lt; desc &lt;&lt; "\n"; return 0; } if (vm.count("compression")) { cout &lt;&lt; "Compression level was set to " &lt;&lt; vm["compression"].as&lt;double&gt;() &lt;&lt; ".\n"; } else { cout &lt;&lt; "Compression level was not set.\n"; } } catch(exception&amp; e) { cerr &lt;&lt; "error: " &lt;&lt; e.what() &lt;&lt; "\n"; return 1; } catch(...) { cerr &lt;&lt; "Exception of unknown type!\n"; } return 0; } </pre><pre class="wiki">[ 50%] Linking CXX executable mem1 Undefined symbols for architecture x86_64: "boost::program_options::validators::check_first_occurrence(boost::any const&amp;)", referenced from: void boost::program_options::validate&lt;double, char&gt;(boost::any&amp;, std::__1::vector&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, std::__1::allocator&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;, double*, long) in main.cpp.o "boost::program_options::to_internal(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;)", referenced from: std::__1::vector&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, std::__1::allocator&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt; &gt; boost::program_options::to_internal&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt;(std::__1::vector&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, std::__1::allocator&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;) in main.cpp.o "boost::program_options::variables_map::variables_map()", referenced from: _main in main.cpp.o "boost::program_options::validation_error::get_template(boost::program_options::validation_error::kind_t)", referenced from: boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, int) in main.cpp.o "boost::program_options::options_description::add_options()", referenced from: _main in main.cpp.o "boost::program_options::options_description::m_default_line_length", referenced from: _main in main.cpp.o "boost::program_options::options_description::options_description(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, unsigned int, unsigned int)", referenced from: _main in main.cpp.o "boost::program_options::invalid_option_value::invalid_option_value(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;)", referenced from: void boost::program_options::validate&lt;double, char&gt;(boost::any&amp;, std::__1::vector&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, std::__1::allocator&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;, double*, long) in main.cpp.o "boost::program_options::error_with_option_name::error_with_option_name(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, int)", referenced from: boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, int) in main.cpp.o "boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)", referenced from: _main in main.cpp.o "boost::program_options::options_description_easy_init::operator()(char const*, char const*)", referenced from: _main in main.cpp.o "boost::program_options::arg", referenced from: boost::program_options::typed_value&lt;double, char&gt;::name() const in main.cpp.o "boost::program_options::store(boost::program_options::basic_parsed_options&lt;char&gt; const&amp;, boost::program_options::variables_map&amp;, bool)", referenced from: _main in main.cpp.o "boost::program_options::detail::cmdline::set_additional_parser(boost::function1&lt;std::__1::pair&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;&gt;)", referenced from: boost::program_options::basic_command_line_parser&lt;char&gt;::extra_parser(boost::function1&lt;std::__1::pair&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt;, std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;&gt;) in main.cpp.o "boost::program_options::detail::cmdline::set_options_description(boost::program_options::options_description const&amp;)", referenced from: boost::program_options::basic_command_line_parser&lt;char&gt;::options(boost::program_options::options_description const&amp;) in main.cpp.o "boost::program_options::detail::cmdline::get_canonical_option_prefix()", referenced from: boost::program_options::basic_command_line_parser&lt;char&gt;::run() in main.cpp.o "boost::program_options::detail::cmdline::run()", referenced from: boost::program_options::basic_command_line_parser&lt;char&gt;::run() in main.cpp.o "boost::program_options::detail::cmdline::style(int)", referenced from: boost::program_options::basic_command_line_parser&lt;char&gt;::style(int) in main.cpp.o "boost::program_options::detail::cmdline::cmdline(std::__1::vector&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, std::__1::allocator&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;)", referenced from: boost::program_options::basic_command_line_parser&lt;char&gt;::basic_command_line_parser(int, char const* const*) in main.cpp.o "boost::program_options::notify(boost::program_options::variables_map&amp;)", referenced from: _main in main.cpp.o "boost::program_options::operator&lt;&lt;(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;, boost::program_options::options_description const&amp;)", referenced from: _main in main.cpp.o "boost::program_options::abstract_variables_map::operator[](std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;) const", referenced from: boost::program_options::variables_map::operator[](std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;) const in main.cpp.o "boost::program_options::error_with_option_name::substitute_placeholders(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;) const", referenced from: vtable for boost::exception_detail::clone_impl&lt;boost::exception_detail::error_info_injector&lt;boost::program_options::validation_error&gt; &gt; in main.cpp.o vtable for boost::exception_detail::error_info_injector&lt;boost::program_options::validation_error&gt; in main.cpp.o vtable for boost::program_options::validation_error in main.cpp.o vtable for boost::exception_detail::clone_impl&lt;boost::exception_detail::error_info_injector&lt;boost::program_options::invalid_option_value&gt; &gt; in main.cpp.o vtable for boost::exception_detail::error_info_injector&lt;boost::program_options::invalid_option_value&gt; in main.cpp.o vtable for boost::program_options::invalid_option_value in main.cpp.o "boost::program_options::error_with_option_name::what() const", referenced from: vtable for boost::exception_detail::clone_impl&lt;boost::exception_detail::error_info_injector&lt;boost::program_options::validation_error&gt; &gt; in main.cpp.o vtable for boost::exception_detail::error_info_injector&lt;boost::program_options::validation_error&gt; in main.cpp.o vtable for boost::program_options::validation_error in main.cpp.o vtable for boost::exception_detail::clone_impl&lt;boost::exception_detail::error_info_injector&lt;boost::program_options::invalid_option_value&gt; &gt; in main.cpp.o vtable for boost::exception_detail::error_info_injector&lt;boost::program_options::invalid_option_value&gt; in main.cpp.o vtable for boost::program_options::invalid_option_value in main.cpp.o "boost::program_options::value_semantic_codecvt_helper&lt;char&gt;::parse(boost::any&amp;, std::__1::vector&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, std::__1::allocator&lt;std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;, bool) const", referenced from: vtable for boost::program_options::typed_value&lt;double, char&gt; in main.cpp.o "typeinfo for boost::program_options::error_with_option_name", referenced from: typeinfo for boost::program_options::validation_error in main.cpp.o "typeinfo for boost::program_options::value_semantic_codecvt_helper&lt;char&gt;", referenced from: typeinfo for boost::program_options::typed_value&lt;double, char&gt; in main.cpp.o "vtable for boost::program_options::variables_map", referenced from: boost::program_options::variables_map::~variables_map() in main.cpp.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "vtable for boost::program_options::error_with_option_name", referenced from: boost::program_options::error_with_option_name::error_with_option_name(boost::program_options::error_with_option_name const&amp;) in main.cpp.o boost::program_options::error_with_option_name::~error_with_option_name() in main.cpp.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "vtable for boost::program_options::value_semantic_codecvt_helper&lt;char&gt;", referenced from: boost::program_options::value_semantic_codecvt_helper&lt;char&gt;::value_semantic_codecvt_helper() in main.cpp.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[3]: *** [mem1] Error 1 make[2]: *** [CMakeFiles/mem1.dir/all] Error 2 make[1]: *** [CMakeFiles/mem1.dir/rule] Error 2 make: *** [mem1] Error 2 </pre><p> This example below is working: </p> <pre class="wiki">#include &lt;boost/lambda/lambda.hpp&gt; #include &lt;iostream&gt; #include &lt;iterator&gt; #include &lt;algorithm&gt; int main() { using namespace boost::lambda; typedef std::istream_iterator&lt;int&gt; in; std::for_each( in(std::cin), in(), std::cout &lt;&lt; (_1 * 3) &lt;&lt; " " ); } </pre><p> Thank you, </p> <p> Yoni </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13173 Trac 1.4.3