AMDG Jerry Davis wrote:
I am running ubuntu 9.04
I have built the libs from 1.39.0 with gcc 4.3 and moved them to /usr/local/boost
I have done a $ sudo ldconfig -v and have seen the boost libaries are installed
here is the code, taken from the boost web site:
#include
#include <iostream> #include <string> using namespace std;
int main() { string line; boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );
while (cin) { getline(cin, line); boost::smatch matches; if (boost::regex_match(line, matches, pat)) cout << matches[2] << endl; } }
I can compile ok: g++ -I /usr/local/boost/include/boost-1_39 -c regex_example.cpp
But when I try to link I get a ton of errors, can anyone tell me what I need to do next? -- Jerry
$ g++ -I /usr/local/boost/include/boost-1_39 -L /usr/local/boost/lib regex_example.cpp
You need to link to the regex library with -lboost_regex. (or -lwhatever_the_boost_regex_library_is_named) In Christ, Steven Watanabe