Boost logo

Boost Users :

Subject: [Boost-users] boost::thread include order error
From: Rob Patro (rob.patro_at_[hidden])
Date: 2013-02-13 10:44:44


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) ?

Thanks,
Rob



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