I have installed and built Boost (1.35.0) on my Mac, and things are working beautifully when I create a "pure" C++ project.

My test source file looks like this:

#include <iostream>
#include <boost/regex.hpp>
#include <string>

int main (int argc, char * const argv[]) {
    std::string expr = std::string("(Colo)(u)(r)");
    std::string textToMatch = std::string("Colour, colorize, colours, color");
    boost::regex reg(expr, boost::regex::icase | boost::regex::perl);
    std::string result = regex_replace(textToMatch, reg, "$1$3");
    std::cout << result;
    return 0;
}

It runs and produces the expected output.

However, my intent is to use Boost in a project combined with Objective-C code.

When I use the exact same code in a file called Test.mm and try to compile in XCode, I get compiler errors in cpp_regex_traits.hpp end perl_matcher_hpp:

error: cannot find protocol declaration for "" - in line 799 of cpp_regex_traits
error: expected unqualified-id before '=' token - in lines 259 and 265 of perl_matcher.hpp

I am sure it is just some compiler flag I need to set somewhere, but at the moment I am stumped. Has anyone reading this list successfully mixed objective-c with c++ and the boost library?

Sincerely,
Helge