Boost C++ Libraries: Ticket #10286: Fail regex matching when dynamic linking boost_regex on FreeBSD 8 (9). https://svn.boost.org/trac10/ticket/10286 <p> Simple example: </p> <pre class="wiki">#include &lt;boost/regex.hpp&gt; #include &lt;string&gt; main(int, char *[]) { std::string filter_rules = "cause 16"; std::string::const_iterator start = filter_rules.begin(); std::string::const_iterator end = filter_rules.end(); std::string rule_pattern = "([a-z_]+).*"; boost::regex rule_re(rule_pattern, boost::regex::extended); boost::smatch what; regex_search(filter_rules, what, rule_re); std::string call_param = what[1]; std::string rule_operator = what[2]; std::string value = what[3]; printf("\n0: %s", call_param.c_str()); printf("\n1: %s", rule_operator.c_str()); printf("\n2: %s\n", value.c_str()); } </pre><p> Static linking:<br /> g++ test.cpp -o test -I/opt/boost/1.55.0/include /opt/boost/1.55.0/lib/libboost_regex.a </p> <p> Results:<br /> 0: cause /* It's correct */<br /> 1: <br /> 2: </p> <p> Dynamic linking:<br /> g++ test.cpp -o test -I/opt/boost/1.55.0/include -L/opt/boost/1.55.0/lib -lboost_regex -Wl,-rpath,/opt/boost/1.55.0/lib </p> <p> Results: <br /> 0: /* FAIL! */<br /> 1: <br /> 2: </p> <p> It is manifested on FreeBSD 8 (9), architecture amd64. </p> <p> Boost was builds with next parameters:<br /> ./bootstrap.sh \ <br /> --without-icu \ <br /> --without-libraries=coroutine,graph,graph_parallel,locale,log,math,mpi,random,test,wave \ <br /> --with-python=${py_dir}/bin/python </p> <p> ./b2 --disable-icu </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10286 Trac 1.4.3 John Maddock Thu, 13 Nov 2014 11:16:16 GMT <link>https://svn.boost.org/trac10/ticket/10286#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10286#comment:1</guid> <description> <p> I'm afraid I don't have FreeBSD to test on. However, I note all the regression tests are passing for FreeBSD here: <a href="http://www.boost.org/development/tests/develop/developer/regex.html">http://www.boost.org/development/tests/develop/developer/regex.html</a> </p> <p> My guess is that you have multiple Boost.Regex so's on your system and it's picking the wrong one at run time? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Fri, 08 May 2015 11:58:34 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/10286#comment:2 https://svn.boost.org/trac10/ticket/10286#comment:2 <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">obsolete</span> </li> </ul> Ticket