Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::thread include order error
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-02-13 12:55:39


Le 13/02/13 16:44, Rob Patro a écrit :
> Hi,
>
> I noticed that when I don't include <boost/thread/thread.hpp> before
> the standard library includes, I get the following errors:
>
> In file included from
> /fs/szattic-asmg6/rob/dist/include/boost/thread/lock_types.hpp:14:0,
> from
> /fs/szattic-asmg6/rob/dist/include/boost/thread/pthread/thread_data.hpp:12,
>
> from /fs/szattic-asmg6/rob/dist/include/boost/thread/thread.hpp:17,
> from /fs/szattic-asmg7/rob/countseq/include/iterative_optimizer.hpp:26,
> from /fs/szattic-asmg7/rob/countseq/src/sailfish.cpp:33:
> /fs/szattic-asmg6/rob/dist/include/boost/thread/lockable_traits.hpp:90:37:
> error: expected identifier before ‘*’ token
> /fs/szattic-asmg6/rob/dist/include/boost/thread/lockable_traits.hpp:114:37:
> error: expected identifier before ‘*’ token
>
> However, when I move the boost thread include to the top of the set of
> included headers (above the standard library), the
> program compiles and runs correctly. What is the reason for this
> frustrating requirement? Is it possible to eliminate this behavior, so
> that
> <boost/thread/thread.hpp> can be included anywhere (or at least after
> the standard library) ?
>
>
Hi,

could you generate the output of the preprocesor in both cases and see
what is the difference?

Best,
Vicente


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