I tried compiling John Maddock's example code from the URL I provided below, and I get the error below. (I run into a similar error with my own code). Any ideas on how to fix this? System setting? FYI, this is the exact code... <br><br><pre>/*<br> *<br> * Copyright (c) 1998-2002<br> * John Maddock<br> *<br> * Use, modification and distribution are subject to the <br> * Boost Software License, Version 1.0. (See accompanying file <br> * LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)<br> *<br> */<br><br> /*<br> * LOCATION: see <a href="http://www.boost.org">http://www.boost.org</a> for most recent version.<br> * FILE partial_regex_match.cpp<br> * VERSION see <boost/version.hpp><br> * DESCRIPTION: regex_match example using partial matches.<br> */<br><br>#include <string><br>#include <iostream> <br>#include <boost/regex.hpp><br><br>boost::regex e("(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})");<br><br>bool is_possible_card_number(const std::string& input)<br>{<br> //<br> // return false for partial match, true for full match, or throw for <br> // impossible match based on what we have so far...<br> boost::match_results<std::string::const_iterator> what;<br> if(0 == boost::regex_match(input, what, e, boost::match_default | boost::match_partial)) <br> {<br> // the input so far could not possibly be valid so reject it:<br> throw std::runtime_error("Invalid data entered - this could not possibly be a valid card number");<br> }<br> // OK so far so good, but have we finished? <br> if(what[0].matched)<br> {<br> // excellent, we have a result:<br> return true;<br> }<br> // what we have so far is only a partial match...<br> return false;<br>}<br><br>int main(int argc, char* argv[]) <br>{<br> try{<br> std::string input;<br> if(argc > 1)<br> input = argv[1];<br> else<br> std::cin >> input;<br> if(is_possible_card_number(input))<br> {<br> std::cout << "Matched OK..." << std::endl; <br> }<br> else<br> std::cout << "Got a partial match..." << std::endl;<br> }<br> catch(const std::exception& e)<br> {<br> std::cout << e.what() << std::endl; <br> }<br> return 0;<br>}<br><br><br>and again the error<br><br>> test.cpp : (.text._ZN5boost9re_detail12pe</pre><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> r<br>> l_matcherIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS6_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEC1ES6_S6_RNS_13match_resultsIS6_S9_EERKNS_11basic_regexIcSD_EENS_15regex_constants12_match_flagsES6_[boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_m<br> atch<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >)]+0xea): undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, 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)'</blockquote><br>thanks.<br>mike t.<br><br><div><span class="gmail_quote">On 10/30/07, <b class="gmail_sendername">Michael Linck</b> <<a href="mailto:mgl@absolute-performance.com"> mgl@absolute-performance.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">It means that somewhere along the line you handed some template the <br>wrong type. More cannot really be said with the information you have<br>provided.<br><br>mike<br><br>On Tue, 2007-10-30 at 17:28 -0700, Mike Thornton wrote:<br>> Using g++ on a GNU Ubuntu Linux 7.04 machine, I am unable to compile <br>> the boost example code (saved as test.cpp) at<br>><br>> <a href="http://www.boost.org/libs/regex/example/snippets/partial_regex_match.cpp">http://www.boost.org/libs/regex/example/snippets/partial_regex_match.cpp </a><br>><br>> Although I can compile my own code which does not use boost, I get a<br>> lot of garbled output from the example code...part of which is listed<br>> below. Any ideas on what is wrong and how to fix it? <br>><br>> test.cpp : (.text._ZN5boost9re_detail12per<br>> l_matcherIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS6_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEC1ES6_S6_RNS_13match_resultsIS6_S9_EERKNS_11basic_regexIcSD_EENS_15regex_constants12_match_flagsES6_[boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_m <br> atch<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >)]+0xea): undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, 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)' <br>><br>> Thanks.<br>> Mike<br>> _______________________________________________<br>> Boost-users mailing list<br>> <a href="mailto:Boost-users@lists.boost.org">Boost-users@lists.boost.org</a><br>> <a href="http://lists.boost.org/mailman/listinfo.cgi/boost-users"> http://lists.boost.org/mailman/listinfo.cgi/boost-users</a><br><br>_______________________________________________<br>Boost-users mailing list<br><a href="mailto:Boost-users@lists.boost.org">Boost-users@lists.boost.org</a> <br><a href="http://lists.boost.org/mailman/listinfo.cgi/boost-users">http://lists.boost.org/mailman/listinfo.cgi/boost-users</a><br></blockquote></div><br>