I am attempting to write a c++ program using the boost::sregex_iterator and receive a linking error when I attempt to compile. I have used boost multiprecision with success in the past, so I know that at least some boost libraries installed successfully. I am using clang (Apple LLVM version 6.1.0 (clang-602.0.49)) to compile on OS X 10.10.3.
The includes in my program are:
#include <boost/multiprecision/gmp.hpp>
#include <boost/regex.hpp>
and I am using the command line:
c++ -I /usr/local/boost_1_57_0 input.cpp -lgmp -o words
The error message I get is quite long, but begins with:
Undefined symbols for architecture x86_64:
"boost::basic_regex...
I have read a number of other questions about people have similar problems, for example: How to link boost library 1.54 using clang?. From the responses, I gather that I should be linking -lboost_regex-mt, but when I add that to the command line I get the message: "ld: library not found."
My question is, if the problem is just that I need libboost_regex-mt, is there a way to install that without reinstalling all of boost? If I do need to reinstall boost, what should I do differently this time so that I end up with the regex library? If -lboost_regex-mt is not the problem, what do i need to do to be able to use boost regexes?