Boost logo

Boost Users :

Subject: Re: [Boost-users] [Regex] Boost.Regex - can't compile/link...
From: Michael Muratet (mmuratet_at_[hidden])
Date: 2011-02-02 13:59:42


On Feb 2, 2011, at 10:45 AM, Robert Pennington wrote:

> 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?
Hello Rob

I'm not familiar with Windows or the IDE you're using, but the error
indicates to me that the tool is not finding the boost/regex headers.
Do you see an error message 'File not found' associated with the
header include? Do you have your boost home directory in your include
path however your IDE does it?

Cheers

Mike
>
> Thanks in advance,
>
> Rob Pennington
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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