Boost C++ Libraries: Ticket #6927: Boost.Program_options can't link with G++'s Profile features https://svn.boost.org/trac10/ticket/6927 <p> When compiling the Program_options example/first.cpp from tutorial with enabled STL profiling with G++ 4.6.3 on Fedora 15 (see <a class="ext-link" href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/profile_mode.html"><span class="icon">​</span>http://gcc.gnu.org/onlinedocs/libstdc++/manual/profile_mode.html</a>) </p> <pre class="wiki">g++ first.cpp -lboost_program_options -o first -D_GLIBCXX_PROFILE </pre><p> it exits with the following error: </p> <pre class="wiki">/tmp/ccFUvscN.o: In function `boost::program_options::basic_command_line_parser&lt;char&gt;::basic_command_line_parser(int, char const* const*)': first.cpp:(.text._ZN5boost15program_options25basic_command_line_parserIcEC2EiPKPKc[_ZN5boost15program_options25basic_command_line_parserIcEC5EiPKPKc]+0x76): undefined reference to `boost::program_options::detail::cmdline::cmdline(std::__profile::vector&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;)' /tmp/ccFUvscN.o:(.rodata._ZTVN5boost15program_options11typed_valueIicEE[vtable for boost::program_options::typed_value&lt;int, char&gt;]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper&lt;char&gt;::parse(boost::any&amp;, std::__profile::vector&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;, bool) const' collect2: ld returned 1 exit status </pre><p> I also tried with -DBOOST_DETAIL_NO_CONTAINER_FWD which helps for the other boost libs as described in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6029" title="#6029: Bugs: Boost.Regex incompatible with G++'s Profile features (closed: fixed)">#6029</a> but it fails again: </p> <pre class="wiki">g++ first.cpp -lboost_program_options -o first -D_GLIBCXX_PROFILE -DBOOST_DETAIL_NO_CONTAINER_FWD </pre><p> error: </p> <pre class="wiki">/tmp/ccau3LdM.o: In function `boost::program_options::basic_command_line_parser&lt;char&gt;::basic_command_line_parser(int, char const* const*)': first.cpp:(.text._ZN5boost15program_options25basic_command_line_parserIcEC2EiPKPKc[_ZN5boost15program_options25basic_command_line_parserIcEC5EiPKPKc]+0x76): undefined reference to `boost::program_options::detail::cmdline::cmdline(std::__profile::vector&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;)' /tmp/ccau3LdM.o:(.rodata._ZTVN5boost15program_options11typed_valueIicEE[vtable for boost::program_options::typed_value&lt;int, char&gt;]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper&lt;char&gt;::parse(boost::any&amp;, std::__profile::vector&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;, bool) const' collect2: ld returned 1 exit status </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6927 Trac 1.4.3 Vladimir Prus Mon, 28 May 2012 05:46:55 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6927#comment:1 https://svn.boost.org/trac10/ticket/6927#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> You need to build program_options library with the same defines, and they change what 'vector' really is. </p> Ticket