Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2007-07-19 11:55:30


Kimon Hoffmann wrote:
> while setting up the include paths as specified in the TR1
> documentation I stumbled across a Boost.Fusion related compile error
> (included indirectly from <xpressive/proto/proto.hpp> in my code).
>
> After stepping through the include hierarchy, I was able to extract
> this minimal example, that demonstrates the problem:
>
>
> - -------- START: Test.cpp --------
>
> // Originally included from <boost/xpressive/proto/proto_fwd.hpp>
> #include <boost/spirit/fusion/sequence/tuple_forward.hpp>
>
> // Originally included from #include
> <boost/xpressive/proto/op_base.hpp> #include
> <boost/spirit/fusion/sequence/tuple.hpp>
>
> - -------- END: Test.cpp --------
>
> With MSVC++ 8.0 SP1 This file fails to compile with certain include
> path orderings while it compiles fine with others. The error messages
> are:
>
> ...\boost\spirit\fusion\sequence\make_tuple.hpp(23) : error C2027: use
> of undefined type 'boost::fusion::tuple<>'
> ...\boost\spirit\fusion\sequence\make_tuple.hpp(23) : error C2079:
> 'boost::fusion::make_tuple' uses undefined struct
> 'boost::fusion::tuple<>'
> ...\include\boost\spirit\fusion\sequence\make_tuple.hpp(24) : error
> C2514: 'boost::fusion::tuple<>' : class has no constructors
>
> Working include path orderings:
> 1. Any include path ordering that doesn't contain Boost.TR1
> 2. VC++ Standard Library, regular Boost, Boost.TR1
> 3. VC++ Standard Library, Boost.TR1, regular Boost
>
> Non-working include path orderings:
> 1. Boost.TR1, regular Boost, VC++ Standard Library [*]
> 2. Regular Boost, Boost.TR1, VC++ Standard Library
>
> [*] Preferred Boost.TR1 setting
>
> Generally speaking I would not consider this a problem, as I can
> simply order the include directories accordingly, but, as far as I
> understand it, Boost.TR1 can not be expected to work correctly with
> any of these settings.

Correct, since the TR1 library replaces parts of your std lib, you need it's
include path before all others. Turned out to be a bit of a maintainance
nightmare that one :-(

Off hand I can't spot the problem: only the indirect cause - that
tuple_basic.hpp never gets included. However, there is a simple temporary
fix: put #include <utility> as your first include, and everything *seems* to
be OK. It is a bug though, I just can't see what it is in fusion that's
causing the failure at present.

HTH, John.


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