Linking with Boost Regex delivers this message:

Undefined symbols for architecture x86_64:
  "boost::regex_error::regex_error(std::string const&, boost::regex_constants::error_type, long)", referenced from:
      boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fixup_recursions(boost::re_detail::re_syntax_base*) in tools_utils.o
      boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmaps(boost::re_detail::re_syntax_base*) in tools_utils.o
      boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::create_startmap(boost::re_detail::re_syntax_base*, unsigned char*, unsigned int*, unsigned char) in tools_utils.o
      boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::string, long) in tools_utils.o
  "boost::re_detail::lookup_default_collate_name(std::string const&)", referenced from:
      boost::re_detail::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const in tools_utils.o
ld: symbol(s) not found for architecture x86_64



According to the Stack Overflow link [1], the problem lies in a clang bug. But I updated to the latest version I could find and it's still there.

Apparently the BOOST_REGEX_NO_EXTERNAL_TEMPLATES define does work on preventing the hack on the template keyword, on boost/regex/v4/instances.hpp.

Anyone else had this bug?

Thanks for any help letting me compile without ugly hacks,
Rodrigo

I'm using Mac OS X 10.8.4, and compiling with C++11.

> c++ --version
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix

References:
[1] http://stackoverflow.com/questions/10879284/how-to-dynamically-build-and-link-boostregex-with-hidden-inlines