Boost logo

Boost Users :

Subject: Re: [Boost-users] Error with GCC and TR1 (error: no include path in which to search for tr1/type_traits)
From: Anthony Foglia (AFoglia_at_[hidden])
Date: 2010-04-19 10:11:08


Anteru wrote about including GCC's TR1 tuple:
> So I'd really like to pull in the TR1 implementation from the compiler,
> to avoid these collisions. In order to fix this, I tried to define
> BOOST_HAS_GCC_TR1 as specified in the docs -- without success, I'm
> getting now
> /usr/include/boost/tr1/type_traits.hpp:13:49: error: no include path in
> which to search for tr1/type_traits
>
> As described in the docs, I added several more defines:
> DBOOST_HAS_GCC_TR1
> BOOST_TR1_DISABLE_INCLUDE_NEXT=1
> BOOST_TR1_GCC_INCLUDE_PATH=/usr/include/c++/4.4/
>
> without success, I'm still getting the "no include path" error. I'm
> using the system boost, which is installed in /usr/include/boost; and
> I'd really like to keep using it. Is there any other way to force Boost
> to pick up the compiler's TR1 library?

I think this is the bug I found two months ago. The macro
BOOST_TR1_DISABLE_INCLUDE_NEXT is not being checked when it should be.
The workaround is to explicitly undefine BOOST_HAS_INCLUDE_NEXT before
including boost/tr1/tuple.hpp, like so:

#define BOOST_HAS_TR1_TUPLE 1
#include <boost/tr1/detail/config.hpp>
#undef BOOST_HAS_INCLUDE_NEXT
#include <boost/tr1/tuple.hpp>

Here's my post about the issue, and the response from John Maddock
announcing a patch:

http://old.nabble.com/-TR1--Using-Boost.TR1-installed-in--usr-include-with-GCC-td27724253.html#a27724253

-- 
Anthony Foglia
Princeton Consultants
(609) 987-8787 x233

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