Boost logo

Boost Users :

Subject: Re: [Boost-users] [Spirit] compilation problem
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2010-04-05 20:31:34


> I have a simple Spirit parser program which won't compile. I am
> running boost 1_42_0 with gcc on a mac. The code and error message are
> attached.
>
> I hope you can tell me two things: first, what have I done wrong, and
> second (if necessary), how can I figure out what I've done wrong from
> the error message.

First, you missed to include

    #include <boost/fusion/include/std_pair.hpp>

which is necessary to make std::pair a fusion sequence. Second, after adding
this it still fails to compile as you're trying to use this
std::pair<std::string, std::string> as the attribute for an 'alnum >> alnum'
parser, which exposes a tuple<char, char> and your attribute is not
compatible with this (you can't directly construct a string from a single
char).

HTH
Regards Hartmut

---------------
Meet me at BoostCon
www.boostcon.com


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