|
Boost Users : |
Subject: [Boost-users] [Regex] Boost.Regex - can't compile/link...
From: Robert Pennington (robpennington84_at_[hidden])
Date: 2011-02-02 11:45:12
Hey there,
I am trying to compile a very simple example program that I copied from the
boost getting started guide for windows (after successfully running a bjam
complete build). BTW: I am using the gcc compiler within the Code::Blocks
IDE on Windows XP.
Here is the code, just in case:
==========================================================
#include <boost/regex.hpp>
#include <iostream>
#include <string>
int main()
{
std::string line;
boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );
while (std::cin)
{
std::getline(std::cin, line);
boost::smatch matches;
if (boost::regex_match(line, matches, pat))
std::cout << matches[2] << std::endl;
}
}
==========================================================
Every time I try to compile this code (by hitting the 'Build and Run' button
in Code::Blocks), I get a whole bunch of error messages. The first one I get
is: "C:\Program
Files\boost\boost_1_45_0\boost\regex\v4\cpp_regex_traits.hpp|366|undefined
reference to
`boost::re_detail::cpp_regex_traits_char_layer<char>::init()'|". Any ideas?
Thanks in advance,
Rob Pennington
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net