Boost logo

Boost :

Subject: Re: [boost] Error while linking boost. spirit
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-06-23 05:58:26

Could you fix your mail client, please? Your message has problems with line
endings, which makes it nearly unreadable.

On Sunday 23 June 2013 09:40:48 ... ... wrote:
> Hi,
> I just downloaded, compiled and install boost.It seems like the installation
> process worked fine and I successfully compiled a program using boost
> (boost.log for instance). But when I try to compile an example writed by
> the developpers of boost.spirit, it fail ! It doesn't seem like it's an
> inclusion resolution problems, I don't know what to do. Please help me.

Well, the compiler tells you what the problem is, just read the errors
carefully. It's not about linking, actually.

> Here is my code (I paste it from this page) :
> #include <stdio.h>
> #include <stdlib.h>
> #include <boost/spirit/include/lex_lexertl.hpp>
> #include <boost/spirit/include/phoenix_operator.hpp>
> #include <boost/spirit/include/phoenix_statement.hpp>
> #include <boost/spirit/include/phoenix_algorithm.hpp>
> #include <boost/spirit/include/phoenix_core.hpp>
> #define BOOST_ALL_DYN_LINK//without it boost.log glitch
> #include <boost/log/trivial.hpp>
> int main(){
> BOOST_LOG_TRIVIAL(trace) << "boost.log is working !";
> typedef lex::lexertl::token<char const*, lex::omit, boost::mpl::false_>
> token_type;


> And here is my error log :
> synthax_analyser.cpp: In function
> ‘int main()’:synthax_analyser.cpp:24:4: error: ‘lex’ does not name a
> type

The compiler is telling you that it can't find 'lex' in the global namespace.
Either you forgot to prepend it with 'boost::spirit::' or there's a missing
using declaration or namespace alias.

Boost list run by bdawes at, gregod at, cpdaniel at, john at